Skip to content

Instantly share code, notes, and snippets.

@jeffmo
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffmo/f9db99b6c197327a30a7 to your computer and use it in GitHub Desktop.
Save jeffmo/f9db99b6c197327a30a7 to your computer and use it in GitHub Desktop.
# __tests__/foo-test.coffee
describe 'hai', ->
it 'asdf', ->
foo = require '../foo'
console.log foo
it 'asdf2', ->
foo = require '../foo'
console.log foo
# foo.coffee
module.exports = 42;
{
"name": "test",
"dependencies": {
"coffee-script": "*",
"jest-cli": "*"
},
"jest": {
"scriptPreprocessor": "<rootDir>/preprocessor.js",
"testFileExtensions": ["coffee", "js"],
"moduleFileExtensions": ["js", "json", "coffee"]
}
}
var coffee = require('coffee-script');
module.exports = {
process: function(src, path) {
// CoffeeScript files can be .coffee, .litcoffee, or .coffee.md
if (coffee.helpers.isCoffee(path)) {
return coffee.compile(src, {'bare': true});
}
return src;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment