From 32f501f23fb210e0da4b3a03e71adb54c750c209 Mon Sep 17 00:00:00 2001 From: MadeByMike Date: Tue, 6 Oct 2020 11:19:39 +1100 Subject: [PATCH] fix config test --- src/EleventyServe.js | 2 -- test/EleventyServeTest.js | 15 ++++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/EleventyServe.js b/src/EleventyServe.js index e9ff4bb6f..2a7a00393 100644 --- a/src/EleventyServe.js +++ b/src/EleventyServe.js @@ -118,8 +118,6 @@ class EleventyServe { const browserSync = require("browser-sync"); this.server = browserSync.create(); - console.log("server created"); - let pathPrefix = this.getPathPrefix(); if (this.savedPathPrefix && pathPrefix !== this.savedPathPrefix) { diff --git a/test/EleventyServeTest.js b/test/EleventyServeTest.js index ad6dd69dc..3afcf3597 100644 --- a/test/EleventyServeTest.js +++ b/test/EleventyServeTest.js @@ -8,19 +8,22 @@ test.before(async () => { }); test("Constructor", (t) => { - let es = new EleventyServe(templateConfig); + let es = new EleventyServe(); + es.config = templateConfig; t.is(es.getPathPrefix(), "/"); }); test("Directories", (t) => { - let es = new EleventyServe(templateConfig); + let es = new EleventyServe(); + es.config = templateConfig; es.setOutputDir("_site"); t.is(es.getRedirectDir("test"), "_site/test"); t.is(es.getRedirectFilename("test"), "_site/test/index.html"); }); test("Get Options", (t) => { - let es = new EleventyServe(templateConfig); + let es = new EleventyServe(); + es.config = templateConfig; es.config = { pathPrefix: "/", }; @@ -40,7 +43,8 @@ test("Get Options", (t) => { }); test("Get Options (with a pathPrefix)", (t) => { - let es = new EleventyServe(templateConfig); + let es = new EleventyServe(); + es.config = templateConfig; es.config = { pathPrefix: "/web/", }; @@ -63,7 +67,8 @@ test("Get Options (with a pathPrefix)", (t) => { }); test("Get Options (override in config)", (t) => { - let es = new EleventyServe(templateConfig); + let es = new EleventyServe(); + es.config = templateConfig; es.config = { pathPrefix: "/", browserSyncConfig: {