Skip to content

Commit 4a0073f

Browse files
committed
Make test runnable from bb CI
1 parent afd85d5 commit 4a0073f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

deps.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
{:extra-paths ["test"]
3838
:jvm-opts ["-Dclojure.main.report=stderr"]
3939
:extra-deps {nubank/matcher-combinators {:mvn/version "3.9.1"}
40+
babashka/fs {:mvn/version "0.5.26"}
4041
hiccup/hiccup {:mvn/version "2.0.0-RC5"}}
4142
:exec-fn test-runner/run}
4243

test/nextjournal/markdown/multi_threading_test.clj

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
(ns nextjournal.markdown.multi-threading-test
2-
(:require [clojure.test :as t :refer [deftest testing is]]
2+
(:require [babashka.fs :as fs]
3+
[clojure.java.io :as io]
4+
[clojure.test :as t :refer [deftest is]]
35
[nextjournal.markdown :as md]))
46

7+
(def notebook-file
8+
;; we do this so test can be executed from arbitrary directory (i.e. in babashka's test suite)
9+
(-> (or (io/resource *file*) *file*)
10+
fs/parent
11+
fs/parent
12+
fs/parent
13+
fs/parent
14+
(fs/file "notebooks" "reference.md")))
15+
516
(deftest multithreading
617
(let [!exs (atom [])
718
proc (fn []
8-
(try (md/parse (slurp "notebooks/reference.md"))
19+
(try (md/parse (slurp notebook-file))
920
(catch IllegalStateException e
1021
(swap! !exs conj e))))
1122
t1 (new Thread proc)

0 commit comments

Comments
 (0)