Skip to content

Commit

Permalink
chore(deps): introduce open and remove opn (#1865)
Browse files Browse the repository at this point in the history
Because opn was renamed to open.
  • Loading branch information
hiroppy committed Jun 5, 2019
1 parent 2323d45 commit f2d4f13
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/utils/runOpen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const open = require('opn');
const open = require('open');

function runOpen(uri, options, log) {
let openOptions = {};
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"ip": "^1.1.5",
"killable": "^1.0.1",
"loglevel": "^1.6.2",
"opn": "^5.5.0",
"open": "^6.2.0",
"portfinder": "^1.0.20",
"schema-utils": "^1.0.0",
"selfsigned": "^1.10.4",
Expand Down
12 changes: 6 additions & 6 deletions test/Server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
const { relative, sep } = require('path');
const webpack = require('webpack');
const request = require('supertest');
// Mock opn before loading Server
jest.mock('opn');
// Mock open before loading Server
jest.mock('open');
// eslint-disable-next-line import/newline-after-import
const opn = require('opn');
opn.mockImplementation(() => {
const open = require('open');
open.mockImplementation(() => {
return {
catch: jest.fn(),
};
Expand Down Expand Up @@ -176,8 +176,8 @@ describe('Server', () => {
});

compiler.hooks.done.tap('webpack-dev-server', () => {
expect(opn.mock.calls[0]).toEqual(['http://localhost:8080/', {}]);
expect(opn.mock.invocationCallOrder[0]).toEqual(1);
expect(open.mock.calls[0]).toEqual(['http://localhost:8080/', {}]);
expect(open.mock.invocationCallOrder[0]).toEqual(1);
server.close(done);
});

Expand Down

0 comments on commit f2d4f13

Please sign in to comment.