Skip to content

Commit e159253

Browse files
committed
wip
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 3aa488c commit e159253

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ However, there are older versions of this plugin, that support
3131
```shell
3232
npm i -D @cyclonedx/webpack-plugin
3333
yarn add -D @cyclonedx/webpack-plugin
34+
pnpm add -D @cyclonedx/webpack-plugin
3435
```
3536

3637
## Usage

tests/integration/setup.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,33 @@ const path = require('path');
3333
// endregion regression tests
3434
]
3535

36+
const SetupMapMethodCmdArgs = {
37+
npm: ['npm', ['ci']],
38+
yarn: ['yarn', ['install', '--immutable']],
39+
pnpm: ['pnpm', ['install', '--frozen-lockfile']]
40+
}
41+
3642
console.warn(`
3743
WILL SETUP INTEGRATION TEST BEDS
3844
THAT MIGHT CONTAIN OUTDATED VULNERABLE PACKAGES
3945
FOR SHOWCASING AND TESTING PURPOSES ONLY.
4046
`)
4147

4248
process.exitCode = 0
43-
let done
49+
50+
const setupMethod = (process.argv[2] || 'npm').toLowerCase()
51+
const setupMethodCmdArgs = SetupMapMethodCmdArgs[setupMethod]
52+
if (undefined === setupMethodCmdArgs) {
53+
throw new RangeError(`
54+
Unsupported setupMethod: ${setupMethod}
55+
Supported values: ${Object.keys(SetupMapMethodCmdArgs).join(' ')}
56+
`)
57+
}
4458

4559
for (const DIR of REQUIRES_NPM_INSTALL) {
46-
console.log('>>> setup with NPM:', DIR)
47-
done = spawnSync(
48-
'npm', ['ci'], {
60+
console.log(`>>> setup with ${setupMethod}:`, DIR)
61+
const done = spawnSync(
62+
...setupMethodCmdArgs, {
4963
cwd: path.resolve(__dirname, DIR),
5064
stdio: 'inherit',
5165
shell: true

0 commit comments

Comments
 (0)