auto use babal-core/register? and no effect in test file?
XGHeaven opened this issue · 2 comments
XGHeaven commented
The first question is
question 1:
babel-istabul
usebabel-core/register
automatically?
Then, I have follow project:
- foo.js
- test
- foo.spec.js
And ,the second question is
question 2: Why can I use
import
infoo.js
, not infoo.spec.js
?
jeffrifwald commented
@XGHeaven This tool does not make assumptions about how you are going to run your tests, so it does not use register.
The reason you are having trouble with syntax in your spec file likely means you are not running your tests through babel. Try running your tests with babel-node
instead of node
.
XGHeaven commented
@jmcriffey
babel-node
has a bug, So I have to use node5.
class Test extends Map {
get() { return 1; }
}
new Test().get()
in babel-node
undefined
in node5
1