mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 05:42:40 +00:00
Move test setup to BEFORE delay
This commit is contained in:
@@ -1,14 +1,13 @@
|
|||||||
const supertest = require('supertest');
|
const supertest = require('supertest');
|
||||||
|
|
||||||
const start = Date.now();
|
|
||||||
console.log(`START DELAY ${Date.now().toString()}`);
|
|
||||||
while (Date.now() < start + 10000){};
|
|
||||||
console.log(`END DELAY ${Date.now().toString()}`);
|
|
||||||
|
|
||||||
// Mimic https responses to avoid being redirected all the time
|
// Mimic https responses to avoid being redirected all the time
|
||||||
const app = supertest.agent(require('app.js').app)
|
const app = supertest.agent(require('app.js').app)
|
||||||
.set('X-Forwarded-Proto', 'https');
|
.set('X-Forwarded-Proto', 'https');
|
||||||
|
|
||||||
|
const timeout = 10000; //ms
|
||||||
|
const start = Date.now();
|
||||||
|
while (Date.now() < start + timeout){};
|
||||||
|
|
||||||
describe('Tests for static pages', ()=>{
|
describe('Tests for static pages', ()=>{
|
||||||
it('Home page works', ()=>{
|
it('Home page works', ()=>{
|
||||||
return app.get('/').expect(200);
|
return app.get('/').expect(200);
|
||||||
|
|||||||
Reference in New Issue
Block a user