summaryrefslogtreecommitdiff
path: root/spec/integration/js
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-05-05 15:28:58 -0600
committermo khan <mo.khan@gmail.com>2020-05-05 16:14:51 -0600
commit60ac0f2df85e4e4655b96b358dcc1ba40fe61a3e (patch)
tree426602110fc42533d35b12c4a24557510faa4b95 /spec/integration/js
parent8e427c7987e90a028e6d9f344a9f70bb13b6eee4 (diff)
Specify npm cafile setting
* [cafile](https://docs.npmjs.com/using-npm/config#cafile) * Use host network for development scripts * Specify path to JAVA keystore in list command * Add CHANGELOG entry
Diffstat (limited to 'spec/integration/js')
-rw-r--r--spec/integration/js/npm_spec.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/integration/js/npm_spec.rb b/spec/integration/js/npm_spec.rb
index 9cc1565..0658df6 100644
--- a/spec/integration/js/npm_spec.rb
+++ b/spec/integration/js/npm_spec.rb
@@ -464,4 +464,42 @@ RSpec.describe "npm" do
specify { expect(subject.licenses_for(item[0])).to match_array(item[2]) }
end
end
+
+ context "when scanning a project with dependencies sourced from a custom registry" do
+ subject { runner.scan(env: { 'ADDITIONAL_CA_CERT_BUNDLE' => fixture_file_content('js/custom-npm.crt') }) }
+
+ before do
+ runner.add_file(".npmrc", "registry = https://#{private_npm_host}")
+ runner.add_file("package.json") do
+ JSON.pretty_generate({
+ name: "js-npm",
+ version: "1.0.0",
+ description: "Test project for js-npm",
+ dependencies: { lodash: "4.17.10" },
+ devDependencies: {},
+ scripts: { test: "echo 'test'" }
+ })
+ end
+ runner.add_file("package-lock.json") do
+ JSON.pretty_generate({
+ name: "js-npm",
+ version: "1.0.0",
+ lockfileVersion: 1,
+ requires: true,
+ dependencies: {
+ lodash: {
+ version: "4.17.10",
+ resolved: "https://#{private_npm_host}/lodash/-/lodash-4.17.10.tgz",
+ integrity: "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
+ }
+ }
+ })
+ end
+ end
+
+ specify { expect(subject).to match_schema(version: '2.0') }
+ specify { expect(subject.dependency_names).to match_array(%w[js-npm lodash]) }
+ specify { expect(subject.licenses_for('js-npm')).to match_array(['MIT']) }
+ specify { expect(subject.licenses_for('lodash')).to match_array(['MIT']) }
+ end
end