mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-19 23:17:16 +03:00
Test it.
This commit is contained in:
parent
f2d2ff6f3c
commit
563984a7b2
@ -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
4
spec/fixtures/babel/flow-comment.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/* @flow */
|
||||
|
||||
const f: Function = v => v + 1
|
||||
module.exports = f
|
Loading…
Reference in New Issue
Block a user