Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fixes nodejs tests #696

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/utils/unsupported.js
Expand Up @@ -7,7 +7,8 @@ var supportedNode = [
{ver: '10', min: '10.0.0'},
{ver: '11', min: '11.0.0'},
{ver: '12', min: '12.0.0'},
{ver: '13', min: '13.0.0'}
{ver: '13', min: '13.0.0'},
{ver: '14', min: '14.0.0'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for doing this in advance :-)

could perhaps this logic be changed to use semver so that every new node version is always treated as supported unless explicitly marked as not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's in our radar to change that for v7 👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it’d also be nice tho for the last 6.x build to not report that new nodes are unsupported forever :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, that's a good point! I agree 👍 that could be a good community contribution wink wink

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #697 (i'll need some help)

]
var knownBroken = '<6.2.0 || 9.0 - 9.2'

Expand Down
2 changes: 2 additions & 0 deletions scripts/release.sh
Expand Up @@ -12,6 +12,8 @@ node ./bin/npm-cli.js pack --loglevel error >/dev/null
mv *.tgz release
cd release
tar xzf *.tgz
cp ../.npmrc package/
cp -r ../tap-snapshots package/
cp -r ../test package/

mkdir node_modules
Expand Down
5 changes: 4 additions & 1 deletion test/tap/ci.js
Expand Up @@ -15,7 +15,10 @@ const File = Tacks.File
const cacheDir = common.cache
const testDir = common.pkg

const EXEC_OPTS = { cwd: testDir }
const EXEC_OPTS = {
cwd: testDir,
nodeExecPath: process.execPath
}

const PKG = {
name: 'top',
Expand Down
6 changes: 5 additions & 1 deletion test/tap/prepare.js
Expand Up @@ -55,7 +55,11 @@ test('test', function (t) {
common.npm([
'pack',
'--loglevel', 'warn'
], { cwd: pkg, env: env }, function (err, code, stdout, stderr) {
], {
cwd: pkg,
env: env,
nodeExecPath: process.execPath
}, function (err, code, stdout, stderr) {
t.equal(code, 0, 'pack finished successfully')
t.ifErr(err, 'pack finished successfully')

Expand Down
3 changes: 2 additions & 1 deletion test/tap/prepublish-only.js
Expand Up @@ -98,7 +98,8 @@ test('test', function (t) {
common.npm(
[
'publish',
'--loglevel', 'warn'
'--loglevel', 'warn',
'--scripts-prepend-node-path'
],
{
cwd: pkg,
Expand Down
2 changes: 1 addition & 1 deletion test/tap/publish-scoped.js
Expand Up @@ -46,7 +46,7 @@ test('npm publish should honor scoping', function (t) {

fs.writeFileSync(configFile, configuration.join('\n') + '\n')

common.npm(['publish'], {'cwd': pkg}, function (err, code, stdout, stderr) {
common.npm(['publish'], {'cwd': pkg, nodeExecPath: process.execPath}, function (err, code, stdout, stderr) {
if (err) throw err
t.is(code, 0, 'published without error')
server.done()
Expand Down
5 changes: 4 additions & 1 deletion test/tap/publish.js
Expand Up @@ -52,7 +52,10 @@ test('basic npm publish', (t) => {
`--//localhost:${server.port}/:username=username`,
`--//localhost:${server.port}/:_password=` + Buffer.from('password').toString('base64'),
`--//localhost:${server.port}/:email=` + 'ogd@aoaioxxysz.net'
], {'cwd': testDir})
], {
'cwd': testDir,
nodeExecPath: process.execPath
})
.spread((code, stdout, stderr) => {
t.comment(stdout)
t.comment(stderr)
Expand Down
5 changes: 3 additions & 2 deletions test/tap/umask-lifecycle.js
Expand Up @@ -40,12 +40,13 @@ test('setup', function (t) {
})

test('umask script', function (t) {
common.npm(['run', 'umask'], {
common.npm(['run', 'umask', '--scripts-prepend-node-path'], {
cwd: pkg,
env: {
PATH: process.env.PATH,
Path: process.env.Path,
'npm_config_loglevel': 'warn'
'npm_config_loglevel': 'warn',
nodeExecPath: process.execPath
}
}, function (er, code, sout, serr) {
t.equal(sout, expected)
Expand Down
2 changes: 1 addition & 1 deletion test/tap/version-no-package.js
Expand Up @@ -7,7 +7,7 @@ test('npm version in a prefix with no package.json', function (t) {
process.chdir(pkg)
common.npm(
['version', '--json', '--prefix', pkg],
{ cwd: pkg },
{ cwd: pkg, nodeExecPath: process.execPath },
function (er, code, stdout, stderr) {
t.ifError(er, "npm version doesn't care that there's no package.json")
t.notOk(code, 'npm version ran without barfing')
Expand Down