-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -404,133 +404,147 @@ t.test('should show install keeps dirty --workspace flag', async t => { | |
assert.packageInstalled('node_modules/[email protected]') | ||
}) | ||
|
||
t.test('should utilize devEngines success case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'node', | ||
t.test('devEngines', async t => { | ||
const globals = { | ||
'process.platform': 'linux', | ||
'process.arch': 'x86', | ||
'process.version': 'v1337.0.0', | ||
} | ||
|
||
t.test('should utilize devEngines success case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
globals, | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'node', | ||
}, | ||
}, | ||
}, | ||
}), | ||
}, | ||
}), | ||
}, | ||
}) | ||
await npm.exec('install', []) | ||
t.matchSnapshot(joinedFullOutput()) | ||
Check failure on line 430 in test/lib/commands/install.js GitHub Actions / Test - macOS - 18.17.0
Check failure on line 430 in test/lib/commands/install.js GitHub Actions / Test - macOS - 18.x
Check failure on line 430 in test/lib/commands/install.js GitHub Actions / Test - macOS - 20.5.0
Check failure on line 430 in test/lib/commands/install.js GitHub Actions / Test - macOS - 20.x
|
||
}) | ||
await npm.exec('install', []) | ||
t.matchSnapshot(joinedFullOutput()) | ||
}) | ||
|
||
t.test('should utilize devEngines failure case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
t.test('should utilize devEngines failure case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
globals, | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
}, | ||
}, | ||
}, | ||
}), | ||
}, | ||
}), | ||
}, | ||
}) | ||
await t.rejects( | ||
npm.exec('install', []) | ||
) | ||
t.matchSnapshot(joinedFullOutput()) | ||
}) | ||
await t.rejects( | ||
npm.exec('install', []) | ||
) | ||
t.matchSnapshot(joinedFullOutput()) | ||
}) | ||
|
||
t.test('should utilize devEngines failure force case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
config: { | ||
force: true, | ||
}, | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
t.test('should utilize devEngines failure force case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
config: { | ||
force: true, | ||
}, | ||
globals, | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
}, | ||
}, | ||
}, | ||
}), | ||
}, | ||
}), | ||
}, | ||
}) | ||
await npm.exec('install', []) | ||
t.matchSnapshot(joinedFullOutput()) | ||
Check failure on line 473 in test/lib/commands/install.js GitHub Actions / Test - macOS - 18.17.0
Check failure on line 473 in test/lib/commands/install.js GitHub Actions / Test - macOS - 18.x
Check failure on line 473 in test/lib/commands/install.js GitHub Actions / Test - macOS - 20.5.0
Check failure on line 473 in test/lib/commands/install.js GitHub Actions / Test - macOS - 20.x
|
||
}) | ||
await npm.exec('install', []) | ||
t.matchSnapshot(joinedFullOutput()) | ||
}) | ||
|
||
t.test('should utilize devEngines 2x warning case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
onFail: 'warn', | ||
}, | ||
cpu: { | ||
name: 'risv', | ||
onFail: 'warn', | ||
t.test('should utilize devEngines 2x warning case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
globals, | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
onFail: 'warn', | ||
}, | ||
cpu: { | ||
name: 'risv', | ||
onFail: 'warn', | ||
}, | ||
}, | ||
}, | ||
}), | ||
}, | ||
}), | ||
}, | ||
}) | ||
await npm.exec('install', []) | ||
t.matchSnapshot(joinedFullOutput()) | ||
Check failure on line 497 in test/lib/commands/install.js GitHub Actions / Test - macOS - 18.17.0
Check failure on line 497 in test/lib/commands/install.js GitHub Actions / Test - macOS - 18.x
Check failure on line 497 in test/lib/commands/install.js GitHub Actions / Test - macOS - 20.5.0
Check failure on line 497 in test/lib/commands/install.js GitHub Actions / Test - macOS - 20.x
|
||
}) | ||
await npm.exec('install', []) | ||
t.matchSnapshot(joinedFullOutput()) | ||
}) | ||
|
||
t.test('should utilize devEngines 2x error case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
onFail: 'error', | ||
}, | ||
cpu: { | ||
name: 'risv', | ||
onFail: 'error', | ||
t.test('should utilize devEngines 2x error case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
globals, | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
onFail: 'error', | ||
}, | ||
cpu: { | ||
name: 'risv', | ||
onFail: 'error', | ||
}, | ||
}, | ||
}, | ||
}), | ||
}, | ||
}), | ||
}, | ||
}) | ||
await t.rejects( | ||
npm.exec('install', []) | ||
) | ||
t.matchSnapshot(joinedFullOutput()) | ||
}) | ||
await t.rejects( | ||
npm.exec('install', []) | ||
) | ||
t.matchSnapshot(joinedFullOutput()) | ||
}) | ||
|
||
t.test('should utilize devEngines failure and warning case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
}, | ||
cpu: { | ||
name: 'risv', | ||
onFail: 'warn', | ||
t.test('should utilize devEngines failure and warning case', async t => { | ||
const { npm, joinedFullOutput } = await loadMockNpm(t, { | ||
globals, | ||
prefixDir: { | ||
'package.json': JSON.stringify({ | ||
name: 'test-package', | ||
version: '1.0.0', | ||
devEngines: { | ||
runtime: { | ||
name: 'nondescript', | ||
}, | ||
cpu: { | ||
name: 'risv', | ||
onFail: 'warn', | ||
}, | ||
}, | ||
}, | ||
}), | ||
}, | ||
}), | ||
}, | ||
}) | ||
await t.rejects( | ||
npm.exec('install', []) | ||
) | ||
t.matchSnapshot(joinedFullOutput()) | ||
}) | ||
await t.rejects( | ||
npm.exec('install', []) | ||
) | ||
t.matchSnapshot(joinedFullOutput()) | ||
}) |