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/docs.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/docs.js')
-rw-r--r-- | test/lib/docs.js | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/test/lib/docs.js b/test/lib/docs.js index 48ba9a3b5..b4ede8731 100644 --- a/test/lib/docs.js +++ b/test/lib/docs.js @@ -5,30 +5,30 @@ const pacote = { manifest: async (spec, options) => { return spec === 'nodocs' ? { name: 'nodocs', - version: '1.2.3' - } - : spec === 'docsurl' ? { - name: 'docsurl', - version: '1.2.3', - homepage: 'https://bugzilla.localhost/docsurl' - } - : 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', - homepage: 'https://example.com' } - : null - } + : spec === 'docsurl' ? { + name: 'docsurl', + version: '1.2.3', + homepage: 'https://bugzilla.localhost/docsurl', + } + : 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', + homepage: 'https://example.com', + } + : null + }, } // keep a tally of which urls got opened @@ -41,7 +41,7 @@ const openUrl = (url, errMsg, cb) => { const docs = requireInject('../../lib/docs.js', { pacote, - '../../lib/utils/open-url.js': openUrl + '../../lib/utils/open-url.js': openUrl, }) t.test('completion', t => { @@ -58,7 +58,7 @@ t.test('open docs urls', t => { docsurl: 'https://bugzilla.localhost/docsurl', repourl: 'https://github.com/foo/repourl#readme', repoobj: 'https://github.com/foo/repoobj#readme', - '.': 'https://example.com' + '.': 'https://example.com', } const keys = Object.keys(expect) t.plan(keys.length) |