Skip to content

Commit 2ad2845

Browse files
committed
tests: fix domain tests after changing to url as var
1 parent 2a61860 commit 2ad2845

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

test/specs/utils/utils.connect.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ describe("Connection snippetUtils", function () {
157157

158158
assert.include(bs.options.get("snippet"), "<script async id=\"__bs_script__\" src=\"http://localhost:3000/browser-sync");
159159

160-
var expected = "___browserSync___.io('http://localhost:3000/browser-sync'";
160+
var expected = "___browserSync___.url = 'http://localhost:3000/browser-sync'";
161161

162162
req(bs.server)
163163
.get(bs.options.getIn(["scriptPaths", "path"]))
@@ -180,7 +180,7 @@ describe("Connection snippetUtils", function () {
180180
var port = bs.options.get("port");
181181
assert.include(bs.options.get("snippet"), "<script async id=\"__bs_script__\" src=\"http://localhost:" + port + "/browser-sync");
182182

183-
var expected = "___browserSync___.io('http://localhost:" + port + "/browser-sync'";
183+
var expected = "___browserSync___.url = 'http://localhost:" + port + "/browser-sync'";
184184

185185
req(bs.server)
186186
.get(bs.options.getIn(["scriptPaths", "path"]))
@@ -231,12 +231,14 @@ describe("Connection snippetUtils", function () {
231231
domain: "http://localhost:{port}"
232232
}
233233
}, function (err, bs) {
234+
var port = bs.options.get("port");
234235
req(bs.server)
235236
.get(bs.options.getIn(["scriptPaths", "path"]))
236237
.expect(200)
237238
.end(function (err, res) {
238-
// console.log(res.text)
239-
assert.ok(res.text.match(/io\('http:\/\/localhost:\d{4,5}\/browser-sync/));
239+
240+
var expected = "___browserSync___.url = 'http://localhost:" + port + "/browser-sync'";
241+
assert.include(res.text, expected);
240242
bs.cleanup();
241243
done();
242244
});

0 commit comments

Comments
 (0)