Skip to content

Commit

Permalink
Add shadow build for auto testing
Browse files Browse the repository at this point in the history
  • Loading branch information
logseq-cldwalker authored and andelf committed Jan 21, 2022
1 parent 6e1d107 commit 558784a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/dev-practices.md
Expand Up @@ -15,3 +15,11 @@ There are outstanding linting items that are currently ignored to allow linting

* Comments starting with `TODO:lint`
* Code marked with `#_:clj-kondo/ignore` require a good understanding of the context to address as they usually involve something with a side effect or require changing multiple fns up the call stack.

## Testing

We have unit and end to end tests as described in https://github.com/logseq/logseq#5-run-tests.

### Unit Testing

When writing unit tests it is helpful to have tests automatically run on file save with `clojure -M:test watch test-auto`. For more about the shadow-cljs test runner, see [this documentation](https://shadow-cljs.github.io/docs/UsersGuide.html#_testing).
6 changes: 6 additions & 0 deletions shadow-cljs.edn
Expand Up @@ -71,6 +71,12 @@
:closure-defines {frontend.util/NODETEST true}
:devtools {:enabled false}}

:test-auto {:target :node-test
:output-to "static/tests.js"
:closure-defines {frontend.util/NODETEST true}
:devtools {:enabled false}
:autorun true}

:publishing {:target :browser
:module-loader true
:js-options {:ignore-asset-requires true}
Expand Down

0 comments on commit 558784a

Please sign in to comment.