]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for nodejs cookbook
authorTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 19:36:59 +0000 (19:36 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 19:37:08 +0000 (19:37 +0000)
.kitchen.yml
.travis.yml
test/integration/nodejs/serverspec/nodejs_spec.rb [new file with mode: 0644]

index d994aee92d4779851f513dcb89c8ca1bd67dcfd1..6c8d8a4bbcb9ba611410340dac4645e013ca4c56 100644 (file)
@@ -114,6 +114,9 @@ suites:
   - name: networking
     run_list:
       - recipe[networking::default]
+  - name: nodejs
+    run_list:
+      - recipe[nodejs::default]
   - name: ntp
     run_list:
       - recipe[ntp::default]
index f4212920f42619bf76a10fb546e19ae59af39850..d12cb11647601608168edaf970f3d22cc44073a3 100644 (file)
@@ -65,6 +65,9 @@ jobs:
     - name: "Test Kitchen (networking)"
       script:
         - bundle exec kitchen test networking-ubuntu-1804
+    - name: "Test Kitchen (nodejs)"
+      script:
+        - bundle exec kitchen test nodejs-ubuntu-1804
     - name: "Test Kitchen (ntp)"
       script:
         - bundle exec kitchen test ntp-ubuntu-1804
diff --git a/test/integration/nodejs/serverspec/nodejs_spec.rb b/test/integration/nodejs/serverspec/nodejs_spec.rb
new file mode 100644 (file)
index 0000000..f63cb11
--- /dev/null
@@ -0,0 +1,12 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("nodejs") do
+  it { should be_installed }
+end
+
+describe package("npm") do
+  it { should be_installed }
+end