From 15f1b3347c92e2bf33f4fb92d4d8cf718d55059e Mon Sep 17 00:00:00 2001 From: Vano Devium Date: Fri, 8 Nov 2019 15:10:33 +0200 Subject: [PATCH] Added tests for invalid and wildCard ranges with --newest option --- test/test-ncu.js | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/test/test-ncu.js b/test/test-ncu.js index 2ff56456..b7438685 100644 --- a/test/test-ncu.js +++ b/test/test-ncu.js @@ -226,6 +226,47 @@ describe('npm-check-updates', function () { }); }); + it('should work with --newest option with any invalid or wildcard range', () => { + return Promise.all([ + ncu.run({ + jsonAll: true, + newest: true, + packageData: JSON.stringify({ + dependencies: { + 'del': '' + } + }) + }), + ncu.run({ + jsonAll: true, + newest: true, + packageData: JSON.stringify({ + dependencies: { + 'del': 'invalid range' + } + }) + }), + ncu.run({ + jsonAll: true, + newest: true, + packageData: JSON.stringify({ + dependencies: { + 'del': '*' + } + }) + }), + ncu.run({ + jsonAll: true, + newest: true, + packageData: JSON.stringify({ + dependencies: { + 'del': '~' + } + }) + }) + ]); + }); + it('should enable --engines-node matching ', () => { return ncu.run({ jsonAll: true,