-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use
me.raystubbs/check
and happy-dom
for testing
- Loading branch information
Showing
18 changed files
with
566 additions
and
2,797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns dev | ||
(:require | ||
["happy-dom" :as happy-dom])) | ||
|
||
(defn create-window ^js [& {:as opts}] | ||
(happy-dom/Window. (clj->js opts))) | ||
|
||
(defn dispose-window [^js/Window window] | ||
(-> window .-happyDOM .waitUntilComplete | ||
(.then | ||
(fn [] | ||
(-> window .-happyDOM .close))))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(ns test | ||
(:require | ||
[check.core :as check] | ||
[subzero.core] | ||
[subzero.rstore] | ||
[subzero.plugins.html])) | ||
|
||
(defn handle-status | ||
[status] | ||
(when-not (some #(= ::check/pending %) (vals status)) | ||
(when (some #(= ::check/failure %) (vals status)) | ||
(System/exit 1)))) | ||
|
||
(defn- run | ||
[& _args] | ||
(add-watch check/!status ::status (fn [_ _ _ status] (handle-status status))) | ||
(handle-status @check/!status)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(ns test | ||
(:require | ||
[check.core :as check] | ||
[subzero.core] | ||
[subzero.rstore] | ||
[subzero.plugins.html] | ||
[subzero.plugins.web-components])) | ||
|
||
(defn handle-status | ||
[status] | ||
(when-not (some #(= ::check/pending %) (vals status)) | ||
(when (some #(= ::check/failure %) (vals status)) | ||
(js/process.exit 1)))) | ||
|
||
(add-watch check/!status ::status (fn [_ _ _ status] (handle-status status))) | ||
(handle-status @check/!status) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
{ | ||
"scripts": { | ||
"test": "shadow-cljs compile browser-tests node-tests && web-test-runner \"target/browser-tests/all.js\" --node-resolve && node target/node-tests.js" | ||
"test": "shadow-cljs compile test && node --enable-source-maps target/test/all.js" | ||
}, | ||
"devDependencies": { | ||
"@web/test-runner": "^0.18.1", | ||
"happy-dom": "^15.8.0", | ||
"shadow-cljs": "^2.28.4" | ||
} | ||
} | ||
}, | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
{:deps {:aliases [:test-cljs]} | ||
{:deps {:aliases [:dev]} | ||
|
||
:builds | ||
{:browser-tests | ||
{:test | ||
{:target :esm | ||
:output-dir "target/browser-tests" | ||
:ns-regexp ".+[-]btest$" | ||
:modules {:all {:entries [subzero.component-btest]}}} | ||
|
||
:node-tests | ||
{:target :node-test | ||
:ns-regexp ".+[-]test$" | ||
:output-to "target/node-tests.js"}}} | ||
:runtime :node | ||
:output-dir "target/test" | ||
:js-options {:js-provider :import} | ||
:modules {:all {:entries [dev test]}}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.