Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soulim/air
Air is an experimental test runner.
https://github.com/soulim/air
Last synced: about 13 hours ago
JSON representation
Air is an experimental test runner.
- Host: GitHub
- URL: https://github.com/soulim/air
- Owner: soulim
- Created: 2023-11-21T11:29:42.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-11-24T08:48:11.000Z (12 months ago)
- Last Synced: 2023-11-24T22:27:05.665Z (12 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Air
_Air_ is an experimental test runner.
## Concept
- No test framework is required to write tests.
- No assertion libraries is required to use in tests.
- Any class can be a test suite.
- Any method of a test suite with its name starting with the `test_` prefix is
treated as a test.Goals:
- No need to bring and maintain yet another dependency into your project.
- No need to learn a domain-specific language of any testing framework.
- No need to switch mental context between writing code and expressing tests for
that code in the language of any testing framework.## Example
Define a test suite:
```javascript
import { Runner } from "../air.js";// A simple test suite.
class Simple {
// The test runner ignores this property even if its name starts with
// the "test_" prefix.
get test_getter() {}// The test runner treats this method as a test because its name starts
// with the expected prefix.
test_foo() {
let exp = "Foo";
let act = "Quox";if (act !== exp) {
throw new Error(`want = "${exp}", got = "${act}"`);
}
}
}let runner = new Runner();
let suite = new Simple();runner.run(suite);
```Run:
```shell
> node testdata/simple.test.jsError: want = "Foo", got = "Quox"
at Simple.test_foo (file:///.../src/github.com/soulim/air/testdata/simple.test.js:11:10)
...
```## Name
Air is something we barely notice and never learn how to use. We just breathe.
## License
Copyright (c) 2023 Alexander Sulim
Air is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.