Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit 58081b5

Browse files
author
Michael Perrotte
committedFeb 28, 2020
chore: small linting change
1 parent 8c4ac7f commit 58081b5

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed
 

‎index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ const cmd = module.exports = {}
99

1010
class MembershipDetail {}
1111
cmd.set = (org, user, role, opts = {}) => {
12-
if (typeof role === 'object' &&
13-
Object.keys(opts).length === 0) {
12+
if (
13+
typeof role === 'object' &&
14+
Object.keys(opts).length === 0
15+
) {
1416
opts = role
1517
role = undefined
1618
}

‎test/fixtures/tnock.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
const nock = require('nock')
44

5+
nock.disableNetConnect()
6+
57
module.exports = tnock
68
function tnock (t, host) {
79
const server = nock(host)

‎test/index.js

+16-10
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@ test('set', t => {
1919
user: 'myuser',
2020
role: 'admin'
2121
}
22-
tnock(t, OPTS.registry).put('/-/org/myorg/user', {
23-
user: 'myuser',
24-
role: 'admin'
25-
}).reply(201, memDeets)
26-
return org.set('myorg', 'myuser', 'admin', OPTS).then(res => {
27-
t.deepEqual(res, memDeets, 'got a membership details object back')
28-
})
22+
tnock(t, OPTS.registry)
23+
.put('/-/org/myorg/user', {
24+
user: 'myuser',
25+
role: 'admin'
26+
})
27+
.reply(201, memDeets)
28+
29+
return org.set('myorg', 'myuser', 'admin', OPTS)
30+
.then(res => {
31+
t.deepEqual(res, memDeets, 'got a membership details object back')
32+
})
2933
})
3034

3135
test('optional role for set', t => {
@@ -58,9 +62,11 @@ test('rm', t => {
5862
tnock(t, OPTS.registry).delete('/-/org/myorg/user', {
5963
user: 'myuser'
6064
}).reply(204)
61-
return org.rm('myorg', 'myuser', OPTS).then(() => {
62-
t.ok(true, 'request succeeded')
63-
})
65+
return org.rm('myorg', 'myuser', OPTS)
66+
.then(ret => {
67+
t.equal(ret, null, 'null return value')
68+
t.ok(true, 'request succeeded')
69+
})
6470
})
6571

6672
test('ls with no options', t => {

0 commit comments

Comments
 (0)
This repository has been archived.