Skip to content

Commit f580741

Browse files
committed
tests: fix tests for 7795031
1 parent 7795031 commit f580741

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

test/specs/e2e/e2e.options.logSnippet.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
var browserSync = require("../../../index");
44
var sinon = require("sinon");
5+
var assert = require("chai").assert;
56

67
describe("E2E `logSnippet` option", function () {
78

@@ -28,6 +29,19 @@ describe("E2E `logSnippet` option", function () {
2829
});
2930

3031
it("Can set the log snippet when given in options", function () {
31-
sinon.assert.notCalled(spy);
32+
var calls = spy.getCalls();
33+
var snippet = testString("Copy the following snippet into your website");
34+
var urls = testString("Access URLs");
35+
36+
function testString (match) {
37+
return calls.filter(function (call) {
38+
return call.args.filter(function (arg) {
39+
return arg.indexOf(match) > -1;
40+
}).length;
41+
});
42+
}
43+
44+
assert.equal(snippet.length, 0);
45+
assert.equal(urls.length, 1);
3246
});
3347
});

0 commit comments

Comments
 (0)