diff --git a/src/cli-options.ts b/src/cli-options.ts index 89c54c3e..b1764cdf 100755 --- a/src/cli-options.ts +++ b/src/cli-options.ts @@ -575,6 +575,7 @@ const cliOptions: CLIOption[] = [ }, { long: 'deprecated', + default: true, description: 'Include deprecated packages.', type: 'boolean', }, diff --git a/test/index.test.ts b/test/index.test.ts index 32c4c0c6..0c78e416 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -136,7 +136,7 @@ describe('run', function () { }) describe('deprecated', () => { - it('deprecated excluded by default', async () => { + it('deprecated included by default', async () => { const upgrades = await ncu({ packageData: { dependencies: { @@ -144,10 +144,12 @@ describe('run', function () { }, }, }) - upgrades!.should.deep.equal({}) + upgrades!.should.deep.equal({ + 'ncu-test-deprecated': '2.0.0', + }) }) - it('deprecated included with option', async () => { + it('deprecated included with --deprecated', async () => { const upgrades = await ncu({ deprecated: true, packageData: { @@ -160,6 +162,18 @@ describe('run', function () { 'ncu-test-deprecated': '2.0.0', }) }) + + it('deprecated excluded with --no-deprecated', async () => { + const upgrades = await ncu({ + deprecated: false, + packageData: { + dependencies: { + 'ncu-test-deprecated': '1.0.0', + }, + }, + }) + upgrades!.should.deep.equal({}) + }) }) it('ignore non-string versions (sometimes used as comments)', async () => {