Skip to content

Commit 8dd9f01

Browse files
committed
tests: fix opn stubs
1 parent f3b921b commit 8dd9f01

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

test/specs/e2e/e2e.options.open.browsers.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ describe("E2E browser option with app args", function () {
9494
var stub = sinon.spy(utils, "open");
9595
var opnPath = require.resolve("opn");
9696
require(opnPath);
97-
var opnStub = require("sinon").stub(require.cache[opnPath], "exports");
97+
var opnStub = require("sinon").stub(require.cache[opnPath], "exports")
98+
.returns({catch: function(){}});
9899

99100
browserSync(config, function (err, bs) {
100101
bs.cleanup();
@@ -126,7 +127,8 @@ describe("E2E browser option with app args", function () {
126127
var stub = sinon.spy(utils, "open");
127128
var opnPath = require.resolve("opn");
128129
require(opnPath);
129-
var opnStub = require("sinon").stub(require.cache[opnPath], "exports");
130+
var opnStub = require("sinon").stub(require.cache[opnPath], "exports")
131+
.returns({catch: function(){}});
130132

131133
browserSync(config, function (err, bs) {
132134
bs.cleanup();

test/specs/e2e/e2e.options.open.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ describe("E2E OPEN options with external", function () {
5050
stub = sinon.spy(utils, "open");
5151
opnPath = require.resolve("opn");
5252
require(opnPath);
53-
opnStub = require("sinon").stub(require.cache[opnPath], "exports");
53+
opnStub = require("sinon").stub(require.cache[opnPath], "exports")
54+
.returns({catch: function(){}});
5455
bs = browserSync(config, done).instance;
5556
});
5657

@@ -81,7 +82,8 @@ describe("E2E OPEN options with UI + snippet", function () {
8182
stub = sinon.spy(utils, "open");
8283
opnPath = require.resolve("opn");
8384
require(opnPath);
84-
opnStub = require("sinon").stub(require.cache[opnPath], "exports");
85+
opnStub = require("sinon").stub(require.cache[opnPath], "exports")
86+
.returns({catch: function(){}});
8587
bs = browserSync(config, done).instance;
8688
});
8789

0 commit comments

Comments
 (0)