You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The easiest way is to keep karma-coffee-preprocessor as a devDependency.
You can simple do it by:
npm install karma-coffee-preprocessor --save-dev
Configuration
Following code shows the default configuration
// karma.conf.jsmodule.exports=function(config){config.set({preprocessors: {'**/*.coffee': ['coffee']},coffeePreprocessor: {// options passed to the coffee compileroptions: {bare: true,sourceMap: false},// transforming the filenamestransformPath: function(path){returnpath.replace(/\.coffee$/,'.js')}},// make sure to include the .coffee files not the compiled .js filesfiles: ['**/*.coffee']})}
If you set the sourceMap coffee compiler option to true then the generated source map will be inlined as a data-uri.
Note that paths like "**/.coffee" inside your "preprocessor" list will not match files where you are traversing up a directory (like "../app/.coffee" inside your "files" list) or where your basePath goes up a directory. If you need to match these, use something like preprocessors: { '../**/*.coffee': ['coffee'] }.