-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e575791
commit 8da36a5
Showing
2 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** NOTE: This script is copied into a temp directory by the e2e test and dependencies are installed from the local verdaccio registry. */ | ||
|
||
const ncu = require('npm-check-updates') | ||
const assert = require('assert') | ||
|
||
const registry = process.env.REGISTRY || 'http://localhost:4873' | ||
|
||
// must exit with error code on unhandledRejection, otherwise script will exit with 0 if an assertion fails in the async block | ||
process.on('unhandledRejection', (reason, p) => { | ||
process.exit(1) | ||
}) | ||
|
||
// test | ||
;(async () => { | ||
const upgraded = await ncu.run({ | ||
// --pre 1 to ensure that an upgrade is always suggested even if npm-check-updates is on a prerelease version | ||
pre: true, | ||
packageData: JSON.stringify({ | ||
dependencies: { | ||
'npm-check-updates': '1.0.0', | ||
}, | ||
}), | ||
registry, | ||
}) | ||
|
||
console.info(upgraded) | ||
|
||
assert.notStrictEqual(upgraded['npm-check-updates'], '1.0.0', 'npm-check-updates should be upgraded') | ||
})() |