-
Notifications
You must be signed in to change notification settings - Fork 757
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(snippet): Add snippet.ignorePaths option - fixes #330
- Loading branch information
1 parent
0181b48
commit dd9b284
Showing
7 changed files
with
87 additions
and
7 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,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<meta name="viewport" content="width=device-width"> | ||
<title>Test HTML Page</title> | ||
<link rel="stylesheet" href="assets/style.css"/> | ||
<link rel="stylesheet" href="fonts/roboto/stylesheet.css"/> | ||
</head> | ||
<body> | ||
|
||
<h1 style="font-family: robotoregular, serif">BrowserSync + iFrame</h1> | ||
<a href="forms.html">Forms</a> | ||
<a href="scrolling.html">Scrolling Window</a> | ||
|
||
<iframe src="sass.html" frameborder="0"></iframe> | ||
|
||
</body> | ||
</html> |
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,40 @@ | ||
"use strict"; | ||
|
||
var browserSync = require("../../../index"); | ||
|
||
var assert = require("chai").assert; | ||
var request = require("supertest"); | ||
|
||
describe("E2E snippet ignore paths test", function () { | ||
|
||
var instance; | ||
|
||
before(function (done) { | ||
|
||
var config = { | ||
server: { | ||
baseDir: "test/fixtures" | ||
}, | ||
open: false, | ||
snippetOptions: { | ||
ignorePaths: "iframe.html" | ||
} | ||
}; | ||
instance = browserSync(config, done); | ||
}); | ||
|
||
after(function () { | ||
instance.cleanup(); | ||
}); | ||
|
||
it("does not inject the snippet when excluded path hit", function (done) { | ||
request(instance.server) | ||
.get("/iframe.html") | ||
.set("accept", "text/html") | ||
.expect(200) | ||
.end(function (err, res) { | ||
assert.notInclude(res.text, instance.options.snippet); | ||
done(); | ||
}); | ||
}); | ||
}); |