Clean up server properties

This commit is contained in:
John Hildenbiddle
2020-07-12 11:38:45 -04:00
parent 36c5c336f7
commit e8da21d3dc
3 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
const stripIndent = require('common-tags/lib/stripIndent');
const { serverIP, serverPort } = require('./server.js');
const { URL: serverURL } = require('./server.js');
/**
* Playwright helper for dynamically creating custom docsify sites.
@@ -16,7 +16,7 @@ const { serverIP, serverPort } = require('./server.js');
* @param {string|String[]} [options.styleURLs=['/lib/themes/vue.css']] External CSS to inject via <link rel="stylesheet"> tag(s)
* @param {String} [options.script] JS to inject via <script> tag
* @param {string|String[]} [options.scriptURLs] External JS to inject via <script src="..."> tag(s)
* @param {String} [options.url=`http://${serverIP}:${serverPort}`] URL of local test server
* @param {String} [options.url=serverURL] URL of local test server
* @param {String} [options.docsifyURL='/lib/docsify.js']
* @param {String} [options.waitForSelector='#main']
*/
@@ -32,7 +32,7 @@ async function docsifyInit(page, options) {
styleURLs: ['/lib/themes/vue.css'],
script: '',
scriptURLs: [],
url: `http://${serverIP}:${serverPort}`,
url: serverURL,
docsifyURL: '/lib/docsify.js',
waitForSelector: '#main',
};
+4 -4
View File
@@ -1,7 +1,7 @@
module.exports = {
serverIP: '127.0.0.1',
serverPort: 8080,
get serverURL() {
return `http://${this.serverIP}:${this.serverPort}`;
host: 'localhost',
port: 8080,
get URL() {
return `http://${this.host}:${this.port}`;
},
};
+4 -4
View File
@@ -1,13 +1,13 @@
const path = require('path');
const liveServer = require('live-server');
const { serverIP, serverPort } = require('./helpers/server.js');
const { host, port } = require('./helpers/server.js');
module.exports = async () => {
global.__SERVER__ = liveServer;
global.__SERVER__ = liveServer; // Instance reference for teardown script
liveServer.start({
host: serverIP,
port: serverPort,
host,
port,
root: path.resolve(__dirname, 'fixtures'),
open: false,
logLevel: 0,