Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Upgrade opn to open
  • Loading branch information
LitoMore committed Jun 28, 2019
commit 6c6a13fb8aee046921166ec5f8410009f1744dcb
4 changes: 2 additions & 2 deletions lib/routes/help.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
const inquirer = require('inquirer');
const opn = require('opn');
const open = require('open');

module.exports = app => {
app.insight.track('yoyo', 'help');
Expand Down Expand Up @@ -31,6 +31,6 @@ module.exports = app => {
return;
}

opn(answer.whereTo);
open(answer.whereTo);
});
};
9 changes: 9 additions & 0 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 @@ -57,7 +57,7 @@
"lodash": "^4.17.10",
"meow": "^3.0.0",
"npm-keyword": "^5.0.0",
"opn": "^5.3.0",
"open": "^6.3.0",
"package-json": "^5.0.0",
"parse-help": "^1.0.0",
"read-pkg-up": "^4.0.0",
Expand Down
8 changes: 4 additions & 4 deletions test/route-help.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ describe('help route', () => {
this.homeRoute = sinon.spy();
this.router = new Router(sinon.stub(), this.insight);
this.router.registerRoute('home', this.homeRoute);
this.opn = sinon.stub();
this.open = sinon.stub();
const helpRoute = proxyquire('../lib/routes/help', {
opn: this.opn
open: this.open
});
this.router.registerRoute('help', helpRoute);
});
Expand Down Expand Up @@ -42,8 +42,8 @@ describe('help route', () => {
const url = 'http://yeoman.io';
this.sandbox.stub(inquirer, 'prompt').returns(Promise.resolve({whereTo: url}));
return this.router.navigate('help').then(() => {
sinon.assert.calledWith(this.opn, url);
sinon.assert.calledOnce(this.opn);
sinon.assert.calledWith(this.open, url);
sinon.assert.calledOnce(this.open);
});
});
});