mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-22 06:39:42 +02:00
Move testing to 3001 port (#8)
Create separate database for testing Add runtime configuration file support
This commit is contained in:
parent
073772c047
commit
452d0ae816
17 changed files with 547 additions and 36 deletions
|
@ -1,6 +1,9 @@
|
|||
const {app} = require('../../bin/www');
|
||||
const model = require('../../src/models/page');
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const config = require('../../config');
|
||||
const chai = require('chai');
|
||||
const chaiHTTP = require('chai-http');
|
||||
const {expect} = chai;
|
||||
|
@ -14,6 +17,14 @@ describe('Pages REST: ', () => {
|
|||
agent = chai.request.agent(app);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
const pathToDB = path.resolve(__dirname, '../../', config.database, './pages.db');
|
||||
|
||||
if (fs.existsSync(pathToDB)) {
|
||||
fs.unlinkSync(pathToDB);
|
||||
}
|
||||
});
|
||||
|
||||
it('Creating page', async () => {
|
||||
const body = {
|
||||
blocks: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue