mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Add test for .coffee.md loading
This commit is contained in:
2
Cakefile
2
Cakefile
@@ -224,7 +224,7 @@ runTests = (CoffeeScript) ->
|
||||
|
||||
# Run every test in the `test` folder, recording failures.
|
||||
files = fs.readdirSync 'test'
|
||||
for file in files when file.match /\.(lit)?coffee$/i
|
||||
for file in files when file.match(/\.(lit)?coffee$/i) or file.match(/\.coffee\.md$/i)
|
||||
literate = helpers.isLiterate file
|
||||
currentFile = filename = path.join 'test', file
|
||||
code = fs.readFileSync filename
|
||||
|
||||
18
test/importing.coffee.md
Normal file
18
test/importing.coffee.md
Normal file
@@ -0,0 +1,18 @@
|
||||
Importing
|
||||
---------
|
||||
|
||||
unless window? or testingBrowser?
|
||||
test "literate coffeescript modules can be imported and executed", ->
|
||||
|
||||
magicKey = __filename
|
||||
magicValue = 0xFFFF
|
||||
|
||||
if global[magicKey]?
|
||||
if exports?
|
||||
local = magicValue
|
||||
exports.method = -> local
|
||||
else
|
||||
global[magicKey] = {}
|
||||
if require?.extensions?
|
||||
ok require(__filename).method() is magicValue
|
||||
delete global[magicKey]
|
||||
Reference in New Issue
Block a user