Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"node": ">=8"
},
"scripts": {
"test": "xo && ava --timeout=20s"
"test": "xo && ava --timeout=20s -s"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should run tests serially for solving the conflict of mock require.

},
"files": [
"index.js",
Expand Down
4 changes: 2 additions & 2 deletions test/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Control(shouldNotifyInNpmScript) {
const setupTest = isNpmReturnValue => {
['..', 'is-npm'].forEach(clearModule);
process.stdout.isTTY = true;
mock('is-npm', isNpmReturnValue || false);
mock('is-npm', {isNpm: isNpmReturnValue || false});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API of [email protected] has been changed. So I updated the mock export.

const updateNotifier = require('..');
util.inherits(Control, updateNotifier.UpdateNotifier);
};
Expand Down Expand Up @@ -70,7 +70,7 @@ test('shouldNotifyInNpmScript should default to false', t => {
t.not(stripAnsi(errorLogs).indexOf('Update available'), -1);
});

test.failing('suppress output when running as npm script', t => {
test('suppress output when running as npm script', t => {
setupTest(true);
const notifier = new Control();
notifier.notify({defer: false});
Expand Down