https://github.com/masylum/j
The smallest testing library in nodejs
https://github.com/masylum/j
Last synced: over 1 year ago
JSON representation
The smallest testing library in nodejs
- Host: GitHub
- URL: https://github.com/masylum/j
- Owner: masylum
- Created: 2011-07-07T16:34:26.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2011-07-07T16:56:05.000Z (about 15 years ago)
- Last Synced: 2025-01-22T12:32:40.675Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 85.9 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# j
**j** is a testing library written in 5 lines of code (or 376 characters) which tries to be performant, with eye-catchy reports and easy to use.
This library is a shameless copy of txus famous [a](https://github.com/txus/a). But smaller.
In order to contribute to **j**, you have to bear in mind that the code must stay under 5 lines and with less than 80 chars per line.
## Usage
RSpec? Cucumber? Vows? Expresso?
F**k, life is too short! Let's use j!!
``` javascript
var test = j();
test([
function setup() {
this.user = {some: 'object'};
}
, function test_user_has_property(assert) {
assert(this.user.some === 'object');
assert(!this.user.other);
}
, function teardown() {
this.user = null;
}
]);
test([
function setup() {
this.foo = [1, 2, 3];
}
, function test_user_has_property(assert) {
assert(this.foo.length === 3);
assert(this.foo[2] > 934); // Should fail at line 27
this.foo[1] = 99;
assert(this.foo[1] !== 2);
}
, function teardown() {
this.bar = 'something';
}
]);
test();
```