@@ -27,7 +27,7 @@ VERSIONED_CSS := static/sf/sf.$(VERSION).css
2727VERSIONED_JS := static/sf/sf.$(VERSION ) .js
2828
2929# ============== Phony Targets ==============
30- .PHONY : banner help assets build build-release test test-quick test-doc test-unit test-one \
30+ .PHONY : banner help assets build build-release test test-quick test-doc test-unit test-frontend test- one \
3131 lint fmt fmt-check clippy ci-local pre-release version package-verify \
3232 bump-patch bump-minor bump-major bump-dry demo-serve \
3333 publish-dry publish clean watch
@@ -84,6 +84,7 @@ test: banner
8484 @printf " $( CYAN) $( BOLD) ╚══════════════════════════════════════╝$( RESET) \n\n"
8585 @printf " $( ARROW) $( BOLD) Running all tests...$( RESET) \n"
8686 @cargo test && \
87+ node --test tests/* .test.js && \
8788 printf " \n$( GREEN) $( CHECK) All tests passed$( RESET) \n\n" || \
8889 (printf " \n$( RED) $( CROSS) Tests failed$( RESET) \n\n" && exit 1)
8990
@@ -99,6 +100,10 @@ test-quick: banner
99100 @cargo test --lib --quiet && \
100101 printf " $( GREEN) $( CHECK) Unit tests passed$( RESET) \n\n" || \
101102 (printf " $( RED) $( CROSS) Unit tests failed$( RESET) \n\n" && exit 1)
103+ @printf " $( PROGRESS) Running frontend tests...\n"
104+ @node --test tests/* .test.js && \
105+ printf " $( GREEN) $( CHECK) Frontend tests passed$( RESET) \n\n" || \
106+ (printf " $( RED) $( CROSS) Frontend tests failed$( RESET) \n\n" && exit 1)
102107
103108test-doc :
104109 @printf " $( PROGRESS) Running doctests...\n"
@@ -112,6 +117,12 @@ test-unit:
112117 printf " $( GREEN) $( CHECK) Unit tests passed$( RESET) \n" || \
113118 (printf " $( RED) $( CROSS) Unit tests failed$( RESET) \n" && exit 1)
114119
120+ test-frontend :
121+ @printf " $( PROGRESS) Running frontend tests...\n"
122+ @node --test tests/* .test.js && \
123+ printf " $( GREEN) $( CHECK) Frontend tests passed$( RESET) \n" || \
124+ (printf " $( RED) $( CROSS) Frontend tests failed$( RESET) \n" && exit 1)
125+
115126test-one :
116127 @printf " $( PROGRESS) Running test: $( YELLOW) $( TEST) $( RESET) \n"
117128 @RUST_LOG=info cargo test $(TEST ) -- --nocapture
@@ -155,8 +166,10 @@ ci-local: banner
155166 @$(MAKE ) clippy --no-print-directory
156167 @printf " $( PROGRESS) Step 5/6: Doctests...\n"
157168 @cargo test --doc --quiet && printf " $( GREEN) $( CHECK) Doctests passed$( RESET) \n"
158- @printf " $( PROGRESS) Step 6/6 : Unit tests...\n"
169+ @printf " $( PROGRESS) Step 6/7 : Unit tests...\n"
159170 @cargo test --lib --quiet && printf " $( GREEN) $( CHECK) Unit tests passed$( RESET) \n"
171+ @printf " $( PROGRESS) Step 7/7: Frontend tests...\n"
172+ @node --test tests/* .test.js && printf " $( GREEN) $( CHECK) Frontend tests passed$( RESET) \n"
160173 @printf " \n$( GREEN) $( BOLD) ╔══════════════════════════════════════════════════════════╗$( RESET) \n"
161174 @printf " $( GREEN) $( BOLD) ║ $( CHECK) CI SIMULATION PASSED ║$( RESET) \n"
162175 @printf " $( GREEN) $( BOLD) ╚══════════════════════════════════════════════════════════╝$( RESET) \n\n"
@@ -196,7 +209,7 @@ pre-release: banner
196209 @$(MAKE ) fmt-check --no-print-directory
197210 @$(MAKE ) clippy --no-print-directory
198211 @printf " $( PROGRESS) Running full test suite...\n"
199- @cargo test --quiet && printf " $( GREEN) $( CHECK) All tests passed$( RESET) \n"
212+ @cargo test --quiet && node --test tests/ * .test.js && printf " $( GREEN) $( CHECK) All tests passed$( RESET) \n"
200213 @printf " $( PROGRESS) Dry-run publish...\n"
201214 @cargo publish --dry-run 2>&1 | tail -1
202215 @printf " $( PROGRESS) Verifying packaged contents...\n"
@@ -273,6 +286,7 @@ help: banner
273286 @/bin/echo -e " $( GREEN) make test-quick$( RESET) - Run doctests + unit tests (fast)"
274287 @/bin/echo -e " $( GREEN) make test-doc$( RESET) - Run doctests only"
275288 @/bin/echo -e " $( GREEN) make test-unit$( RESET) - Run unit tests only"
289+ @/bin/echo -e " $( GREEN) make test-frontend$( RESET) - Run frontend Node tests"
276290 @/bin/echo -e " $( GREEN) make test-one TEST=name$( RESET) - Run specific test with output"
277291 @/bin/echo -e " "
278292 @/bin/echo -e " $( CYAN) $( BOLD) Lint & Format:$( RESET) "
0 commit comments