diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2021-03-01 19:38:43 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-03-02 16:08:55 +0300 |
commit | f3d67000a0a6bdce5cbb9ad506a008e5d709bb71 (patch) | |
tree | 650f0737f1d7676f374b523f27bf9b26bb70bb00 /deps/npm/test/lib/run-script.js | |
parent | 725d48ae777ec23e915370019a60a835a2569711 (diff) |
deps: upgrade npm to 7.6.0
PR-URL: https://github.com/nodejs/node/pull/37559
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Diffstat (limited to 'deps/npm/test/lib/run-script.js')
-rw-r--r-- | deps/npm/test/lib/run-script.js | 48 |
1 files changed, 16 insertions, 32 deletions
diff --git a/deps/npm/test/lib/run-script.js b/deps/npm/test/lib/run-script.js index 070f766b44d..974202aa8c6 100644 --- a/deps/npm/test/lib/run-script.js +++ b/deps/npm/test/lib/run-script.js @@ -42,45 +42,29 @@ const { writeFileSync } = require('fs') t.test('completion', t => { const dir = t.testdir() npm.localPrefix = dir - t.test('already have a script name', t => { - runScript.completion({conf: {argv: {remain: ['npm', 'run', 'x']}}}, (er, results) => { - if (er) - throw er - - t.equal(results, undefined) - t.end() - }) + t.test('already have a script name', async t => { + const res = await runScript.completion({conf: {argv: {remain: ['npm', 'run', 'x']}}}) + t.equal(res, undefined) + t.end() }) - t.test('no package.json', t => { - runScript.completion({conf: {argv: {remain: ['npm', 'run']}}}, (er, results) => { - if (er) - throw er - - t.strictSame(results, []) - t.end() - }) + t.test('no package.json', async t => { + const res = await runScript.completion({conf: {argv: {remain: ['npm', 'run']}}}) + t.strictSame(res, []) + t.end() }) - t.test('has package.json, no scripts', t => { + t.test('has package.json, no scripts', async t => { writeFileSync(`${dir}/package.json`, JSON.stringify({})) - runScript.completion({conf: {argv: {remain: ['npm', 'run']}}}, (er, results) => { - if (er) - throw er - - t.strictSame(results, []) - t.end() - }) + const res = await runScript.completion({conf: {argv: {remain: ['npm', 'run']}}}) + t.strictSame(res, []) + t.end() }) - t.test('has package.json, with scripts', t => { + t.test('has package.json, with scripts', async t => { writeFileSync(`${dir}/package.json`, JSON.stringify({ scripts: { hello: 'echo hello', world: 'echo world' }, })) - runScript.completion({conf: {argv: {remain: ['npm', 'run']}}}, (er, results) => { - if (er) - throw er - - t.strictSame(results, ['hello', 'world']) - t.end() - }) + const res = await runScript.completion({conf: {argv: {remain: ['npm', 'run']}}}) + t.strictSame(res, ['hello', 'world']) + t.end() }) t.end() }) |