diff options
author | Gar <gar+gh@danger.computer> | 2022-02-08 18:33:01 +0300 |
---|---|---|
committer | Gar <wraithgar@github.com> | 2022-02-08 19:44:37 +0300 |
commit | fb6e2ddf942bacf5ae745d16c2d57f3836dce75a (patch) | |
tree | ad5c9be0490d0b14f3204f69ad915a73a9defebf /test/lib | |
parent | b836d596f9d98cd7849882000cad11ad2a0b9a26 (diff) |
fix(log): pass in logger to more external modules
We missed two commands in the last PR. This should complete the task
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/commands/org.js | 63 | ||||
-rw-r--r-- | test/lib/commands/unpublish.js | 9 |
2 files changed, 45 insertions, 27 deletions
diff --git a/test/lib/commands/org.js b/test/lib/commands/org.js index 903b9de4f..b716adc09 100644 --- a/test/lib/commands/org.js +++ b/test/lib/commands/org.js @@ -83,7 +83,8 @@ t.test('npm org add', async t => { await org.exec(['add', 'orgname', 'username']) - t.strictSame( + t.ok(orgSetArgs.opts.log, 'got passed a logger') + t.match( orgSetArgs, { org: 'orgname', @@ -148,7 +149,8 @@ t.test('npm org add - more users', async t => { }) await org.exec(['add', 'orgname', 'username']) - t.strictSame( + t.ok(orgSetArgs.opts.log, 'got passed a logger') + t.match( orgSetArgs, { org: 'orgname', @@ -175,7 +177,8 @@ t.test('npm org add - json output', async t => { await org.exec(['add', 'orgname', 'username']) - t.strictSame( + t.ok(orgSetArgs.opts.log, 'got passed a logger') + t.match( orgSetArgs, { org: 'orgname', @@ -209,7 +212,8 @@ t.test('npm org add - parseable output', async t => { await org.exec(['add', 'orgname', 'username']) - t.strictSame( + t.ok(orgSetArgs.opts.log, 'got passed a logger') + t.match( orgSetArgs, { org: 'orgname', @@ -239,7 +243,8 @@ t.test('npm org add - silent output', async t => { await org.exec(['add', 'orgname', 'username']) - t.strictSame( + t.ok(orgSetArgs.opts.log, 'got passed a logger') + t.match( orgSetArgs, { org: 'orgname', @@ -261,7 +266,8 @@ t.test('npm org rm', async t => { await org.exec(['rm', 'orgname', 'username']) - t.strictSame( + t.ok(orgRmArgs.opts.log, 'got passed a logger') + t.match( orgRmArgs, { org: 'orgname', @@ -270,7 +276,8 @@ t.test('npm org rm', async t => { }, 'libnpmorg.rm received the correct args' ) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -323,7 +330,8 @@ t.test('npm org rm - one user left', async t => { await org.exec(['rm', 'orgname', 'username']) - t.strictSame( + t.ok(orgRmArgs.opts.log, 'got passed a logger') + t.match( orgRmArgs, { org: 'orgname', @@ -332,7 +340,8 @@ t.test('npm org rm - one user left', async t => { }, 'libnpmorg.rm received the correct args' ) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -358,7 +367,8 @@ t.test('npm org rm - json output', async t => { await org.exec(['rm', 'orgname', 'username']) - t.strictSame( + t.ok(orgRmArgs.opts.log, 'got passed a logger') + t.match( orgRmArgs, { org: 'orgname', @@ -367,7 +377,8 @@ t.test('npm org rm - json output', async t => { }, 'libnpmorg.rm received the correct args' ) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -398,7 +409,8 @@ t.test('npm org rm - parseable output', async t => { await org.exec(['rm', 'orgname', 'username']) - t.strictSame( + t.ok(orgRmArgs.opts.log, 'got passed a logger') + t.match( orgRmArgs, { org: 'orgname', @@ -407,7 +419,8 @@ t.test('npm org rm - parseable output', async t => { }, 'libnpmorg.rm received the correct args' ) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -436,7 +449,8 @@ t.test('npm org rm - silent output', async t => { await org.exec(['rm', 'orgname', 'username']) - t.strictSame( + t.ok(orgRmArgs.opts.log, 'got passed a logger') + t.match( orgRmArgs, { org: 'orgname', @@ -445,7 +459,8 @@ t.test('npm org rm - silent output', async t => { }, 'libnpmorg.rm received the correct args' ) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -470,7 +485,8 @@ t.test('npm org ls', async t => { await org.exec(['ls', 'orgname']) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -497,7 +513,8 @@ t.test('npm org ls - user filter', async t => { await org.exec(['ls', 'orgname', 'username']) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -522,7 +539,8 @@ t.test('npm org ls - user filter, missing user', async t => { await org.exec(['ls', 'orgname', 'username']) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -560,7 +578,8 @@ t.test('npm org ls - json output', async t => { await org.exec(['ls', 'orgname']) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -587,7 +606,8 @@ t.test('npm org ls - parseable output', async t => { await org.exec(['ls', 'orgname']) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', @@ -623,7 +643,8 @@ t.test('npm org ls - silent output', async t => { await org.exec(['ls', 'orgname']) - t.strictSame( + t.ok(orgLsArgs.opts.log, 'got passed a logger') + t.match( orgLsArgs, { org: 'orgname', diff --git a/test/lib/commands/unpublish.js b/test/lib/commands/unpublish.js index b1b148a7c..99d55294f 100644 --- a/test/lib/commands/unpublish.js +++ b/test/lib/commands/unpublish.js @@ -76,8 +76,9 @@ t.test('no args --force', async t => { const libnpmpublish = { unpublish (spec, opts) { + t.ok(opts.log, 'gets passed a logger') t.equal(spec.raw, 'pkg@1.0.0', 'should unpublish expected spec') - t.same( + t.match( opts, { publishConfig: undefined, @@ -177,12 +178,8 @@ t.test('unpublish <pkg>@version', async t => { const libnpmpublish = { unpublish (spec, opts) { + t.ok(opts.log, 'gets passed a logger') t.equal(spec.raw, 'pkg@1.0.0', 'should unpublish expected parsed spec') - t.same( - opts, - {}, - 'should unpublish with expected opts' - ) }, } |