https://github.com/davemo/given-sweet
given dsl for sweet js
https://github.com/davemo/given-sweet
Last synced: about 1 year ago
JSON representation
given dsl for sweet js
- Host: GitHub
- URL: https://github.com/davemo/given-sweet
- Owner: davemo
- Created: 2015-11-15T04:30:57.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2021-11-20T01:14:11.000Z (over 4 years ago)
- Last Synced: 2025-04-04T12:07:56.515Z (about 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Given-Sweet
This is mostly just me experimenting with the feasibility of using [sweet.js](https://github.com/mozilla/sweet.js) macros to create a ["Given"'like DSL](https://github.com/searls/jasmine-given) for testing.
## Sample Output so far
from `lib/given.js` as a sweet macro module and run against `spec/sanity.js`
```
describe "adding" {
context "adding 1" {
Given -> x = 5
When -> x += 1
Then -> x == 6
}
}
```
```
console.log('adding');
console.log('adding 1');
x = 5;
x += 1;
require('assert')(x == 6);
```