Skip to content

Commit cd6e9a3

Browse files
committed
Fix cljs tests, run them on CI
1 parent 5be2ec1 commit cd6e9a3

File tree

7 files changed

+33
-28
lines changed

7 files changed

+33
-28
lines changed

.circleci/config.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defaults: &defaults
1616
executors:
1717
openjdk8:
1818
docker:
19-
- image: circleci/clojure:openjdk-8-lein-2.9.5
19+
- image: circleci/clojure:openjdk-8-lein-2.9.1-node
2020
environment:
2121
LEIN_ROOT: "true" # we intended to run lein as root
2222
JVM_OPTS: -Xmx3200m # limit the maximum heap size to prevent out of memory errors
@@ -32,15 +32,15 @@ executors:
3232

3333
openjdk11:
3434
docker:
35-
- image: circleci/clojure:openjdk-11-lein-2.9.5
35+
- image: circleci/clojure:openjdk-11-lein-2.9.3-buster-node
3636
environment:
3737
LEIN_ROOT: "true" # we intended to run lein as root
3838
JVM_OPTS: -Xmx3200m --illegal-access=deny # forbid reflective access (this flag doesn't exist for JDK8 or JDK17+)
3939
<<: *defaults
4040

4141
openjdk17:
4242
docker:
43-
- image: circleci/clojure:openjdk-17-lein-2.9.5-buster
43+
- image: circleci/clojure:openjdk-17-lein-2.9.5-buster-node
4444
environment:
4545
LEIN_ROOT: "true" # we intended to run lein as root
4646
JVM_OPTS: -Xmx3200m
@@ -153,8 +153,11 @@ jobs:
153153
cache_version: << parameters.clojure_version >>|<< parameters.jdk_version >>
154154
steps:
155155
- run:
156-
name: Running tests
156+
name: Running JVM tests
157157
command: make test
158+
- run:
159+
name: Running cljs tests
160+
command: make test-cljs
158161

159162
######################################################################
160163
#

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ clean:
88
test: clean
99
lein with-profile -user,-dev,+$(VERSION) test
1010

11-
test-cljs:
12-
lein cljsbuild once
11+
test-cljs: clean
12+
lein with-profile -user,-dev,+cljsbuild cljsbuild once
1313
node target/cljs/test.js
1414

1515
cljfmt:

README.org

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,6 @@ We get back a sequence of maps, one for each cause, which contain
186186
additional information about each frame discovered from the class path.
187187

188188
** Development
189-
*** Deployment
190-
191-
Here's how to deploy to Clojars:
192-
193-
#+begin_src sh
194-
git tag -a v0.1.0 -m "0.1.0"
195-
git push --tags
196-
#+end_src
197189

198190
*** Creating a parser
199191

@@ -255,6 +247,15 @@ for writing Instaparse grammars:
255247
- If your parser fails on an input, [[https://github.com/Engelberg/instaparse#revealing-hidden-information][reveal hidden information]] to get a
256248
better understanding of what happened.
257249

250+
*** Deployment
251+
252+
Here's how to deploy to Clojars:
253+
254+
#+begin_src sh
255+
git tag -a v0.1.0 -m "0.1.0"
256+
git push --tags
257+
#+end_src
258+
258259
** Changelog
259260

260261
[[CHANGELOG.md][CHANGELOG.md]]

project.clj

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;; whenever we perform a deployment.
33
(defproject mx.cider/haystack (or (not-empty (System/getenv "PROJECT_VERSION"))
44
"0.0.0")
5-
:description ""
5+
:description "Let's make the most of Clojure's infamous stacktraces!"
66
:url "https://github.com/clojure-emacs/haystack"
77
:license {:name "Eclipse Public License"
88
:url "https://www.eclipse.org/legal/epl-v10.html"}
@@ -16,15 +16,7 @@
1616
:username :env/clojars_username
1717
:password :env/clojars_password
1818
:sign-releases false}]]
19-
:plugins [[lein-cljsbuild "1.1.8"]]
20-
:cljsbuild {:builds
21-
[{:id "test"
22-
:compiler
23-
{:main haystack.test.runner
24-
:output-dir "target/cljs/test"
25-
:output-to "target/cljs/test.js"
26-
:target :nodejs}
27-
:source-paths ["src" "test"]}]}
19+
2820
:profiles {:provided {:dependencies [[org.clojure/clojure "1.11.1"]
2921
[org.clojure/clojurescript "1.11.4"]]}
3022

@@ -40,7 +32,16 @@
4032
"https://oss.sonatype.org/content/repositories/snapshots"]]
4133
:dependencies [[org.clojure/clojure "1.12.0-master-SNAPSHOT"]
4234
[org.clojure/clojure "1.12.0-master-SNAPSHOT" :classifier "sources"]]}
43-
35+
:cljsbuild {:plugins [[lein-cljsbuild "1.1.8"]]
36+
:dependencies [[lein-doo "0.1.11"]]
37+
:cljsbuild {:builds
38+
[{:id "test"
39+
:compiler
40+
{:main haystack.test.runner
41+
:output-dir "target/cljs/test"
42+
:output-to "target/cljs/test.js"
43+
:target :nodejs}
44+
:source-paths ["src" "test"]}]}}
4445
:cljfmt [:test
4546
{:plugins [[lein-cljfmt "0.9.0" :exclusions [org.clojure/clojure
4647
org.clojure/clojurescript]]]}]

test/haystack/parser/clojure/repl_test.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
:reason
114114
#?(:clj [{:tag :regexp :expecting "[a-zA-Z0-9_$/-]"}
115115
{:tag :regexp :expecting "[^\\S\\r\\n]+"}]
116-
:cljs [{:tag :regexp, :expecting "/^[a-zA-Z0-9_$\\/-]/"}
116+
:cljs [{:tag :regexp, :expecting "/^[a-zA-Z0-9_$/-]/"}
117117
{:tag :regexp, :expecting "/^[^\\S\\r\\n]+/"}])
118118
:line 1
119119
:column 1

test/haystack/parser/clojure/stacktrace_test.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
:reason
116116
#?(:clj [{:tag :regexp :expecting "[a-zA-Z0-9_$/-]"}
117117
{:tag :regexp :expecting "[^\\S\\r\\n]+"}]
118-
:cljs [{:tag :regexp, :expecting "/^[a-zA-Z0-9_$\\/-]/"}
118+
:cljs [{:tag :regexp, :expecting "/^[a-zA-Z0-9_$/-]/"}
119119
{:tag :regexp, :expecting "/^[^\\S\\r\\n]+/"}])
120120
:line 1
121121
:column 1

test/haystack/parser/java_test.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
:reason
116116
#?(:clj [{:tag :regexp, :expecting "[a-zA-Z0-9_$/-]"}
117117
{:tag :regexp, :expecting "[^\\S\\r\\n]+"}]
118-
:cljs [{:tag :regexp, :expecting "/^[a-zA-Z0-9_$\\/-]/"}
118+
:cljs [{:tag :regexp, :expecting "/^[a-zA-Z0-9_$/-]/"}
119119
{:tag :regexp, :expecting "/^[^\\S\\r\\n]+/"}])
120120
:line 1
121121
:column 1

0 commit comments

Comments
 (0)