Skip to content

Commit

Permalink
Add nbb-test-runner to graph-parser
Browse files Browse the repository at this point in the history
Replaces manual, hardcoded runner
  • Loading branch information
logseq-cldwalker authored and tiensonqin committed Apr 12, 2023
1 parent 7dc9c41 commit 5cce967
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,6 +11,7 @@ pom.xml.asc
/.nrepl-port
.hgignore
.hg/
.nbb/

node_modules/
static/**
Expand Down
17 changes: 12 additions & 5 deletions deps/graph-parser/README.md
Expand Up @@ -42,18 +42,25 @@ This step is not needed if you're just running the frontend application.

Since this library is compatible with cljs and nbb-logseq, tests are run against both languages.

Nbb tests use [nbb-test-runner](https://github.com/nextjournal/nbb-test-runner).
Some basic usage:

```
# Run all tests
$ yarn test
# List available options
$ yarn test -H
# Run tests with :focus metadata flag
$ yarn test -i focus
```

ClojureScript tests use https://github.com/Olical/cljs-test-runner. To run tests:
```
clojure -M:test
```

To see available options that can run specific tests or namespaces: `clojure -M:test --help`

To run nbb-logseq tests:
```
yarn test
```

### Managing dependencies

The package.json dependencies are just for testing and should be updated if there is
Expand Down
6 changes: 6 additions & 0 deletions deps/graph-parser/nbb.edn
@@ -0,0 +1,6 @@
{:paths ["src"]
:deps
{logseq/db
{:local/root "../db"}
io.github.nextjournal/nbb-test-runner
{:git/sha "60ed57aa04bca8d604f5ba6b28848bd887109347"}}}
2 changes: 1 addition & 1 deletion deps/graph-parser/package.json
Expand Up @@ -9,6 +9,6 @@
"mldoc": "^1.5.1"
},
"scripts": {
"test": "nbb-logseq -cp src:test:../db/src -m logseq.graph-parser.nbb-test-runner/run-tests"
"test": "nbb-logseq -cp test -m nextjournal.test-runner"
}
}
31 changes: 0 additions & 31 deletions deps/graph-parser/test/logseq/graph_parser/nbb_test_runner.cljs

This file was deleted.

0 comments on commit 5cce967

Please sign in to comment.