2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

tests: increase mocha timeout to let server start

This commit is contained in:
Faris Ansari 2018-08-18 21:12:55 +05:30
parent 666c4969aa
commit 1aabf7ef40
3 changed files with 21 additions and 5 deletions

18
frappe.conf.js Normal file
View File

@ -0,0 +1,18 @@
module.exports = {
staticPath: './static',
distPath: './dist',
dev: {
outputDir: './dist',
assetsPublicPath: '/',
devServerPort: 8000,
env: {
PORT: process.env.PORT || 8000
}
},
node: {
paths: {
main: 'server/index.js'
}
}
}

View File

@ -7,7 +7,7 @@
"frappe": "cli.js"
},
"scripts": {
"test": "mocha tests",
"test": "NODE_ENV=test mocha --timeout 3000 tests",
"start": "nodemon app.js"
},
"dependencies": {

View File

@ -11,9 +11,7 @@ var test_server;
describe('REST', () => {
before(async function() {
test_server = spawn('node', ['tests/test_server.js'], {
stdio: [process.stdin, process.stdout, process.stderr, 'pipe', 'pipe']
});
test_server = spawn('node', ['tests/test_server.js'], { stdio: 'inherit' });
await frappe.init();
await frappe.login('Administrator');
@ -22,7 +20,7 @@ describe('REST', () => {
frappe.fetch = fetch;
// wait for server to start
await frappe.sleep(1);
return await frappe.sleep(2);
});
after(() => {