diff options
author | isaacs <i@izs.me> | 2020-11-17 04:56:54 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2020-11-17 22:38:18 +0300 |
commit | b1d850960fda95650cd828a7bd8586648d9e2672 (patch) | |
tree | 2f9f436ccdf8b97bcaa87a5e0d236c33068d9444 /test/lib/bugs.js | |
parent | de82b6257d6cb81809be8f9e290d4962929e0c25 (diff) |
lint tests before publishing
We have a lot of tests that were not handling errors in callbacks, not
defining variables, defining variables that weren't used, and just
generally not formatted like the rest of npm.
Hazard of moving fast. Thankfully, machines can help.
Diffstat (limited to 'test/lib/bugs.js')
-rw-r--r-- | test/lib/bugs.js | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/test/lib/bugs.js b/test/lib/bugs.js index 79d508972..df6434987 100644 --- a/test/lib/bugs.js +++ b/test/lib/bugs.js @@ -5,40 +5,40 @@ const pacote = { manifest: async (spec, options) => { return spec === 'nobugs' ? { name: 'nobugs', - version: '1.2.3' - } - : spec === 'bugsurl' ? { - name: 'bugsurl', - version: '1.2.3', - bugs: 'https://bugzilla.localhost/bugsurl' - } - : spec === 'bugsobj' ? { - name: 'bugsobj', - version: '1.2.3', - bugs: { url: 'https://bugzilla.localhost/bugsobj' } - } - : spec === 'bugsobj-nourl' ? { - name: 'bugsobj-nourl', - version: '1.2.3', - bugs: { no: 'url here' } - } - : spec === 'repourl' ? { - name: 'repourl', - version: '1.2.3', - repository: 'https://github.com/foo/repourl' - } - : spec === 'repoobj' ? { - name: 'repoobj', version: '1.2.3', - repository: { url: 'https://github.com/foo/repoobj' } } - : spec === '.' ? { - name: 'thispkg', - version: '1.2.3', - bugs: 'https://example.com' - } - : null - } + : spec === 'bugsurl' ? { + name: 'bugsurl', + version: '1.2.3', + bugs: 'https://bugzilla.localhost/bugsurl', + } + : spec === 'bugsobj' ? { + name: 'bugsobj', + version: '1.2.3', + bugs: { url: 'https://bugzilla.localhost/bugsobj' }, + } + : spec === 'bugsobj-nourl' ? { + name: 'bugsobj-nourl', + version: '1.2.3', + bugs: { no: 'url here' }, + } + : spec === 'repourl' ? { + name: 'repourl', + version: '1.2.3', + repository: 'https://github.com/foo/repourl', + } + : spec === 'repoobj' ? { + name: 'repoobj', + version: '1.2.3', + repository: { url: 'https://github.com/foo/repoobj' }, + } + : spec === '.' ? { + name: 'thispkg', + version: '1.2.3', + bugs: 'https://example.com', + } + : null + }, } // keep a tally of which urls got opened @@ -51,7 +51,7 @@ const openUrl = (url, errMsg, cb) => { const bugs = requireInject('../../lib/bugs.js', { pacote, - '../../lib/utils/open-url.js': openUrl + '../../lib/utils/open-url.js': openUrl, }) t.test('completion', t => { @@ -70,7 +70,7 @@ t.test('open bugs urls', t => { bugsobj: 'https://bugzilla.localhost/bugsobj', repourl: 'https://github.com/foo/repourl/issues', repoobj: 'https://github.com/foo/repoobj/issues', - '.': 'https://example.com' + '.': 'https://example.com', } const keys = Object.keys(expect) t.plan(keys.length) |