Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joy-framework/tester
A testing library for janet
https://github.com/joy-framework/tester
janet
Last synced: about 2 months ago
JSON representation
A testing library for janet
- Host: GitHub
- URL: https://github.com/joy-framework/tester
- Owner: joy-framework
- License: mit
- Created: 2019-08-02T17:58:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-05T04:27:28.000Z (about 4 years ago)
- Last Synced: 2024-08-04T04:01:07.223Z (5 months ago)
- Topics: janet
- Homepage:
- Size: 34.2 KB
- Stars: 14
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-janet - tester
README
# tester
__A testing library for janet__
## Installation
Add the dependency [https://github.com/joy-framework/tester](https://github.com/joy-framework/tester) to your `project.janet` file:
```clojure
(declare-project
:dependencies ["https://github.com/joy-framework/tester"])
```## Usage
Create a `.janet` file for testing and use this library like so:
```clojure
(import tester :prefix "" :exit true)(deftest
(test "1 + 1 = 2"
(is (= 2 (+ 1 1))))(test "expected = actual"
(let [expected "expected"
actual "expected"]
(is (= expected actual)))))
```Run your tests from the terminal with `jpm test` in your project directory
```sh
jpm test
```For a better workflow, use [entr](https://github.com/eradman/entr) to restart `jpm test` automatically on a file change like this:
```clojure
; # ... rest of project.janet above(phony "watch" []
(os/shell "find . -name '*.janet' | entr -r -d jpm test"))
```Then run this from the terminal and you're all set to get a fast running test suite on any file change in `src` or in `test`
```sh
jpm run watch
```## Contribute
Any issues or pull requests are welcome!
## License
MIT