From 79e89adf316b87f7a316fb8ac0d63be789baf151 Mon Sep 17 00:00:00 2001 From: LitoMore Date: Fri, 12 Apr 2019 12:55:09 +0800 Subject: [PATCH] Fix failing test (#155) --- package.json | 2 +- test/notify.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 36433f5..ce1625c 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "node": ">=8" }, "scripts": { - "test": "xo && ava --timeout=20s" + "test": "xo && ava --timeout=20s -s" }, "files": [ "index.js", diff --git a/test/notify.js b/test/notify.js index 0236079..7834d57 100644 --- a/test/notify.js +++ b/test/notify.js @@ -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}); const updateNotifier = require('..'); util.inherits(Control, updateNotifier.UpdateNotifier); }; @@ -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});