Skip to content

Commit

Permalink
fix config test
Browse files Browse the repository at this point in the history
  • Loading branch information
MadeByMike committed Oct 6, 2020
1 parent a26ad09 commit 32f501f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/EleventyServe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
15 changes: 10 additions & 5 deletions test/EleventyServeTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: "/",
};
Expand All @@ -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/",
};
Expand All @@ -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: {
Expand Down

0 comments on commit 32f501f

Please sign in to comment.