Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48cfc6f
commit 87a2381
Showing
6 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use strict"; | ||
|
||
var browserSync = require("../../../"); | ||
|
||
var assert = require("chai").assert; | ||
|
||
describe("Plugins: Retrieving user plugins when given inline", function () { | ||
|
||
var instance; | ||
var PLUGIN_REQUIRE = "bs-html-injector"; | ||
var PLUGIN_NAME = "HTML Injector"; | ||
|
||
before(function (done) { | ||
|
||
browserSync.reset(); | ||
|
||
var config = { | ||
logLevel: "silent", | ||
plugins: [PLUGIN_REQUIRE] | ||
}; | ||
|
||
instance = browserSync(config, done).instance; | ||
}); | ||
after(function () { | ||
instance.cleanup(); | ||
}); | ||
it("Should access to only the user-specified plugins", function (done) { | ||
assert.equal(instance.getUserPlugins().length, 1); | ||
done(); | ||
}); | ||
it("Should access to only the user-specified plugins", function (done) { | ||
var plugin = instance.getUserPlugins()[0]; | ||
assert.equal(plugin.name, PLUGIN_NAME); | ||
done(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"use strict"; | ||
|
||
var browserSync = require("../../../"); | ||
|
||
var assert = require("chai").assert; | ||
|
||
describe("Plugins: Retrieving user plugins when given inline with options", function () { | ||
|
||
var instance; | ||
var PLUGIN_NAME = "HTML Injector"; | ||
|
||
before(function (done) { | ||
|
||
browserSync.reset(); | ||
|
||
var plugin = { | ||
"bs-html-injector": { | ||
files: "*.html" | ||
} | ||
}; | ||
|
||
var config = { | ||
logLevel: "silent", | ||
plugins: [ | ||
{ | ||
"bs-html-injector": { | ||
files: "*.html" | ||
} | ||
} | ||
] | ||
}; | ||
|
||
instance = browserSync(config, done).instance; | ||
}); | ||
after(function () { | ||
instance.cleanup(); | ||
}); | ||
it("Should access to only the user-specified plugins", function (done) { | ||
assert.equal(instance.getUserPlugins().length, 1); | ||
done(); | ||
}); | ||
it("Should access to only the user-specified plugins", function (done) { | ||
var plugin = instance.getUserPlugins()[0]; | ||
assert.equal(plugin.name, PLUGIN_NAME); | ||
done(); | ||
}); | ||
}); |