Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Nov 7, 2024
1 parent a1f702f commit b71d205
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions e2e-test-ws/.joyride/src/test_runner/runner.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -62,36 +62,21 @@
(string/replace #"\.cljs$" "")
(string/replace #"^tests\." "")))

(defn find-test-files+ [dir]
(p/let [js-dir-entries (vscode/workspace.fs.readDirectory dir)
dir-entries (js->clj js-dir-entries)
test-files (p/all (keep (fn [[name type]]
(let [full-path (vscode/Uri.joinPath dir name)]
(if (= type vscode/FileType.Directory)
(find-test-files+ full-path)
(when (and (= type vscode/FileType.File)
(string/ends-with? name "_test.cljs"))
(p/resolved full-path)))))
dir-entries))]
(flatten test-files)))

(defn get-test-namespaces+ [tests-directory]
(p/let [files (find-test-files+ tests-directory)]
(defn find-test-files+ [path]
(p/->> (vscode/workspace.findFiles (str path "/**/*_test.cljs"))
(.map vscode/workspace.asRelativePath)))

(defn get-test-namespaces+ [tests-path]
(p/let [files (find-test-files+ tests-path)]
(def files files)
(->> files
(filter #(test-file? (first %)))
(map #(file->ns (first %)))
(map symbol))))

(comment
(def tests-directory (vscode/Uri.joinPath
(-> vscode/workspace.workspaceFolders
first
.-uri)
"e2e-test-ws"
".joyride"
"src"))
(p/let [test-namespaces (get-test-namespaces+ tests-directory)]
(def tests-path "e2e-test-ws/.joyride/src")
(p/let [test-namespaces (get-test-namespaces+ tests-path)]
(println "test-namespaces" test-namespaces)
(def test-namespaces test-namespaces)
:rcf)
Expand Down

0 comments on commit b71d205

Please sign in to comment.