You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-09-16 09:26:22 +02:00
fix (npmExecuteScripts) pinning @cyclonedx/bom to major version 3 (#4081)
* pinning cyclone dx to major version 3 * fxing unit test Co-authored-by: anilkeshav27 <you@example.com>
This commit is contained in:
@@ -355,7 +355,7 @@ func (exec *Execute) checkIfLockFilesExist() (bool, bool, error) {
|
||||
func (exec *Execute) CreateBOM(packageJSONFiles []string) error {
|
||||
execRunner := exec.Utils.GetExecRunner()
|
||||
// Install CycloneDX Node.js module locally without saving in package.json
|
||||
err := execRunner.RunExecutable("npm", "install", "@cyclonedx/bom", "--no-save")
|
||||
err := execRunner.RunExecutable("npm", "install", "@cyclonedx/bom@^3.10.6", "--no-save")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@@ -357,7 +357,7 @@ func TestNpm(t *testing.T) {
|
||||
|
||||
if assert.NoError(t, err) {
|
||||
if assert.Equal(t, 3, len(utils.execRunner.Calls)) {
|
||||
assert.Equal(t, mock.ExecCall{Exec: "npm", Params: []string{"install", "@cyclonedx/bom", "--no-save"}}, utils.execRunner.Calls[0])
|
||||
assert.Equal(t, mock.ExecCall{Exec: "npm", Params: []string{"install", "@cyclonedx/bom@^3.10.6", "--no-save"}}, utils.execRunner.Calls[0])
|
||||
assert.Equal(t, mock.ExecCall{Exec: "npx", Params: []string{"cyclonedx-bom", ".",
|
||||
"--output", "bom-npm.xml"}}, utils.execRunner.Calls[1])
|
||||
assert.Equal(t, mock.ExecCall{Exec: "npx", Params: []string{"cyclonedx-bom", "src",
|
||||
|
Reference in New Issue
Block a user