Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb')
-rw-r--r--spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb
index 127f437dd54..e3cddceb7a9 100644
--- a/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb
+++ b/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb
@@ -100,5 +100,21 @@ RSpec.describe Gitlab::DependencyLinker::PackageJsonLinker do
it 'does not link scripts with the same key as a package' do
expect(subject).not_to include(link('karma start config/karma.config.js --single-run', 'https://github.com/karma start config/karma.config.js --single-run'))
end
+
+ context 'when dependency is not a string' do
+ let(:file_content) do
+ <<-CONTENT.strip_heredoc
+ {
+ "dependencies": {
+ "wrong": {}
+ }
+ }
+ CONTENT
+ end
+
+ it 'does not link it' do
+ expect(subject).not_to include(%(<a href))
+ end
+ end
end
end