This commit is contained in:
joshaber 2016-02-05 16:16:38 -05:00
parent f2d2ff6f3c
commit 563984a7b2
2 changed files with 9 additions and 0 deletions

View File

@ -36,6 +36,11 @@ describe "Babel transpiler support", ->
transpiled = require('./fixtures/babel/babel-double-quotes.js')
expect(transpiled(3)).toBe 4
describe 'when a .js file starts with /* @flow */', ->
it "transpiles it using babel", ->
transpiled = require('./fixtures/babel/flow-comment.js')
expect(transpiled(3)).toBe 4
describe "when a .js file does not start with 'use babel';", ->
it "does not transpile it using babel", ->
expect(-> require('./fixtures/babel/invalid.js')).toThrow()

4
spec/fixtures/babel/flow-comment.js vendored Normal file
View File

@ -0,0 +1,4 @@
/* @flow */
const f: Function = v => v + 1
module.exports = f