mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
CoffeeScript 2 support for JSX (React only, it seems), with test
This commit is contained in:
@@ -22,7 +22,10 @@ export class CoffeeScriptCompiler {
|
||||
// prevents CoffeeScript projects from using the modules package and
|
||||
// putting require or import statements within backticks; it just
|
||||
// won't happen automatically because of Babel.
|
||||
runtime: false
|
||||
runtime: false,
|
||||
// CoffeeScript 2 supports for JSX, which Meteor supports only for React,
|
||||
// per packages/ecmascript/plugin.js.
|
||||
react: true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -28,3 +28,12 @@ Tinytest.add "coffeescript - import local module via native import statement", (
|
||||
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?
|
||||
|
||||
|
||||
# JSX
|
||||
Tinytest.add "coffeescript - JSX", (test) ->
|
||||
# Mock React
|
||||
React =
|
||||
createElement: (tag, attributes, body) ->
|
||||
"<#{tag}>#{body}</#{tag}>"
|
||||
test.isTrue <div>Hello from JSX!</div> is '<div>Hello from JSX!</div>'
|
||||
|
||||
Reference in New Issue
Block a user