use a port for the tests that doesn't collide with common local server ports

This commit is contained in:
Joe Pea 2020-06-10 11:48:21 -07:00
parent 0438dd6c45
commit 64a231d924

View File

@ -7,7 +7,8 @@ const handler = require('serve-handler');
const { expect } = require('chai'); const { expect } = require('chai');
const { initJSDOM } = require('../_helper'); const { initJSDOM } = require('../_helper');
const docsifySite = 'http://127.0.0.1:3000'; const port = 9753;
const docsifySite = 'http://127.0.0.1:' + port;
const markup = /* html */ `<!DOCTYPE html> const markup = /* html */ `<!DOCTYPE html>
<html> <html>
@ -30,7 +31,7 @@ describe('Docsify public API', () => {
return handler(request, response); return handler(request, response);
}); });
await new Promise(r => server.listen(3000, r)); await new Promise(r => server.listen(port, r));
}); });
after(async () => { after(async () => {