-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ES2015 support to CLI #23
Changes from 7 commits
b326542
253d32a
e8dbe53
591962e
dccdfbc
ba0884c
98baf61
459a518
3ccca95
036e5df
06eef13
c241247
1903489
4f1d30a
86b597d
1dd0954
7933d68
a5f90c5
69e89bf
e2ee116
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,15 @@ var fs = require('fs'); | |
var path = require('path'); | ||
var globby = require('globby'); | ||
var meow = require('meow'); | ||
var resolveFrom = require('resolve-from'); | ||
var updateNotifier = require('update-notifier'); | ||
|
||
try { | ||
require(resolveFrom('.', 'babel/register')); | ||
} catch (e) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
require('babel/register'); | ||
} | ||
|
||
var cli = meow({ | ||
help: [ | ||
'Usage', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
], | ||
"dependencies": { | ||
"async-each-series": "^1.0.0", | ||
"babel": "^5.8.23", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
"chalk": "^1.0.0", | ||
"claim": "^1.3.0", | ||
"each-async": "^1.0.0", | ||
|
@@ -54,6 +55,7 @@ | |
"globby": "^2.0.0", | ||
"meow": "^3.3.0", | ||
"plur": "^2.0.0", | ||
"resolve-from": "^1.0.0", | ||
"squeak": "^1.2.0", | ||
"update-notifier": "^0.5.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,6 +165,54 @@ test.serial(function (t) { | |
``` | ||
|
||
|
||
### Custom assertion module | ||
|
||
You can use any assertion module instead or in addition to the one that comes with AVA, but you won't be able to use the `.plan()` method, [yet](https://github.com/sindresorhus/ava/issues/25). | ||
|
||
```js | ||
var assert = require('assert'); | ||
|
||
test(function (t) { | ||
assert(true); | ||
t.end(); | ||
}); | ||
``` | ||
|
||
|
||
### ES2015 support | ||
|
||
You can write your tests in ES2015: | ||
|
||
```js | ||
test(t => { | ||
t.ok(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
t.end(); | ||
}); | ||
``` | ||
|
||
And run it in any node version. | ||
|
||
```sh | ||
$ ava | ||
``` | ||
|
||
Also you can use your local `babel` instead of built-in. | ||
|
||
For example, package.json: | ||
|
||
```json | ||
{ | ||
"devDependencies": { | ||
"ava": "^0.1.0", | ||
"babel": "^5.8.0" | ||
}, | ||
"scripts": { | ||
"test": "ava" | ||
} | ||
} | ||
``` | ||
|
||
|
||
## API | ||
|
||
### test([name], body) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be
babel-core
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, should probably do both, in case users use plain
babel
.