From c3996dc611b3aef70c87e30bfe448843ef09c18c Mon Sep 17 00:00:00 2001 From: Connor Finley Date: Thu, 14 Sep 2023 15:32:50 -0400 Subject: [PATCH] Use node for tests Don't need/want to do browser tests --- .github/workflows/test.yml | 12 ++++++------ package.json | 21 +++++++++++---------- shadow-cljs.edn | 5 ++++- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2863700..f0517ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,11 +6,11 @@ jobs: test: name: Tests runs-on: ubuntu-20.04 - container: - image: ghcr.io/day8/chrome-latest:5.1.0 steps: - uses: actions/checkout@v3 - - name: npm install - run: 'npm install' - - name: run tests - run: npm run ci + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm ci + - run: 'npm run ci:node' diff --git a/package.json b/package.json index a58adf3..a947c63 100644 --- a/package.json +++ b/package.json @@ -2,18 +2,19 @@ "name": "why-does-that-sound-good", "scripts": { "ancient": "clojure -Sdeps '{:deps {com.github.liquidz/antq {:mvn/version \"RELEASE\"}}}' -m antq.core", - "watch": "npx shadow-cljs watch app karma-test", + "watch": "npx shadow-cljs watch app node-test", "release": "npx shadow-cljs release app", "build-report": "npx shadow-cljs run shadow.cljs.build-report app target/build-report.html", - "ci": "npx shadow-cljs compile karma-test && npx karma start --single-run --reporters junit,dots" - }, - "dependencies": { - "highlight.js": "11.5.1", - "react": "17.0.2", - "react-dom": "17.0.2" - }, - "devDependencies": { - "karma": "6.4.0", + "ci:karma": "npx shadow-cljs compile karma-test && npx karma start --single-run --reporters junit,dots", + "ci:node": "npx shadow-cljs compile node-test && node target/node-test.js" + }, + "dependencies": { + "highlight.js": "11.5.1", + "react": "17.0.2", + "react-dom": "17.0.2" + }, + "devDependencies": { + "karma": "6.4.0", "karma-chrome-launcher": "3.1.1", "karma-cljs-test": "0.1.0", "karma-junit-reporter": "2.0.1", diff --git a/shadow-cljs.edn b/shadow-cljs.edn index c4a3229..b71dbfe 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -45,4 +45,7 @@ :karma-test {:target :karma :ns-regexp "-test$" - :output-to "target/karma-test.js"}}} + :output-to "target/karma-test.js"} + :node-test + {:target :node-test + :output-to "target/node-test.js"}}}