Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Commit

Permalink
Add simple command line argument tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arichiardi committed Aug 22, 2017
1 parent fcba19a commit fa9734a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test:
- yarn test
- boot test
- boot release-ci
- ./build/lumo -c test scripts/lumo_test.cljs
- ./build/lumo -c test scripts/lumo_test.cljs --test-cli-option true
post:
- chmod a+x build/lumo
- zip -j build/lumo.zip build/lumo
8 changes: 8 additions & 0 deletions test/lumo/repl_tests.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,11 @@ Special Form
(is (= () (lumo/apropos ffirst)))
(is (= '(cljs.core/ffirst cljs.core/nfirst) (lumo/apropos #"[a-z]+first")))
(is (= '(cljs.core/aget) (lumo/apropos "aget"))))

(when test-util/lumo-env?
(deftest test-cli-args
;; this requires to run:
;; ./build/lumo -c test scripts/lumo_test.cljs --test-cli-option true
(is (not-any? #(= (.-execPath js/process) %1) cljs.core/*command-line-args*) "It should not contain process.execPath")
(is (not-any? #(= "nexe.js" %1) cljs.core/*command-line-args*) "It should not contain the path to the JavaScript file being executed")
(is (= ["--test-cli-option" "true"] cljs.core/*command-line-args*) "It should contained the expected options (in order)")))

0 comments on commit fa9734a

Please sign in to comment.