Files
meteor/packages/coffeescript/tests/coffeescript_tests.coffee
Geoffrey Booth 12472cfe7a CoffeeScript now supports ES2015 modules (#7818)
* Update CoffeeScript to 1.11.0, which supports modules; update check for whether to pass CoffeeScript’s output to Babel to look not just for backticks, but also for `import`, `export` and `function*`, the current ESNext features output by CoffeeScript

* Add tests for imported modules using CoffeeScript’s new native import statement

* Test that CoffeeScript native export statements work, by importing something exported by such a statement

* Improve regex

* Optimize regex
2016-09-28 09:36:53 -04:00

31 lines
1.4 KiB
CoffeeScript

Meteor.__COFFEESCRIPT_PRESENT = true
# This is read in coffeescript_strict_tests.coffee.
share.coffeeShared = 789
Tinytest.add "coffeescript - compile", (test) -> test.isTrue true
# import/export statements must be top-level
`import { Meteor as testingForBacktickedImportedSymbol } from "meteor/meteor";`
Tinytest.add "coffeescript - import external package via backticked import statement", (test) ->
test.isTrue testingForBacktickedImportedSymbol?
`import { testingForImportedModule987654321 } from "./es2015_module.js";`
Tinytest.add "coffeescript - import local module via backticked import statement", (test) ->
test.isTrue testingForImportedModule987654321?
import { Meteor as testingForNativeImportedSymbol } from "meteor/meteor"
Tinytest.add "coffeescript - import external package via native import statement", (test) ->
test.isTrue testingForNativeImportedSymbol?
import { testingForImportedModule123456789 } from "./es2015_module.js";
Tinytest.add "coffeescript - import local module via native import statement", (test) ->
test.isTrue testingForImportedModule123456789?
import { testingForNativeImportedModule123456789 } from "./coffeescript_module.coffee";
Tinytest.add "coffeescript - import local module exported by a CoffeeScript native export statement, via native import statement", (test) ->
test.isTrue testingForNativeImportedModule123456789?