Giter Site home page Giter Site logo

karma-coffee-preprocessor's People

Contributors

avindra avatar dignifiedquire avatar ehuss avatar johanneswuerbach avatar kylezeeuwen avatar makebbekus avatar maksimr avatar vojtajina avatar whscullin avatar xrd avatar zheller avatar zzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

karma-coffee-preprocessor's Issues

Process hangs in event of transpilation error

If there's a transpilation error, we get a nice log message indicating where the error occurred, but the process hangs indefinitely because the finish callback is never executed (rightfully so, since it would probably cause many other errors down the line).

Unfortunately this has the nasty side effect that anything depending on the process to finish (e.g. a deployment script) will hang indefinitely as well. I think it'd be nice to add the ability to have a callback executed in the event of a transpilation error. I've made the corresponding change here:

https://github.com/waynegerard/karma-coffee-preprocessor/commit/2255cb4687debf080eebdb9144ad02665e9726a0

But just wanted to hear feedback before making a pull request.

peerDependicies not met on install

When trying to install karma and other tests, get the following errors:
npm ERR! peerinvalid The package karma does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants karma@~0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9.3
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.11.14
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9

It works by using 0.1.3 of the preprocessor, but I was wondering if there is another way to get them all installed? 0.1.3 breaks our build server

PhantomJS Parsing Errors when Watching CoffeeScript Specs

Sorry, I am a little confused where exactly to report this issue (lazd/gulp-karma#26) that I am seeing when using gulp watch coffee files. The reason I thought may be it could do something with this preprocessor, was that the error goes away if I switch from coffee specs to javascript specs. Any direction would be appreciated. Thank you.

unexpected INDENT for valid coffee file

The following coffee fails the preprocessor with

ERROR [preprocessor.coffee]: unexpected INDENT

This is just one of many valid coffee files that work with my Rails application but fail with the preprocessor.

App.factory 'Comments', ['$resource', ($resource) ->
  $resource '/comments/:id',{id:'@id'}
    update: { method: 'PUT' }
]

Require.js Compatibility

I'm having trouble getting Require.js to recognize the files loaded by the coffee-script preprocessor. Require.js implicitly adds a '.js' extension to all the referenced locations. It can't find the files loaded by the CS preprocessor because they are loaded into the browser with the '.coffee' extension.

The file contents are being compiled to js... is there any way we can change the extension to match so that everything will act consistently?

Version 0.2.0 breaks Karma 0.9

I'm maintaining a project that is still relying on Karma 0.9 – many of its modules is still strictly relying on 0.9 or is at least not compatible with Karma 0.11 that this module now requires as of b099260.

While it of course isn't an issue in itself that a new version of this modules requires a newer version of Karma it is an issue that the latest version of Karma 0.9 doesn't specify any specific version of this module causing Karma 0.9 to depend on 0.2.0 of this module that in turns requires karma to be 0.11 (I guess it's due to https://github.com/karma-runner/karma/blob/8c38782c015f5d6e9d891771ff07f83423b22377/package.json#L107)

I'm not sure where the error is to be found here – if it is Karma 0.9 that should have specified its version better, if its this module that should have done something in another way or if its my project that should have specified some more elaborate dependencies. Anyhow – since it's the release of 0.2.0 that caused this I thought this would be a good place for a first report of it.

Below is the full error from npm when trying a fresh install of my project:

npm ERR! peerinvalid The package karma does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants karma@~0.9.4 || ~0.10
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@~0.9
npm ERR! peerinvalid Peer [email protected] wants karma@~0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9.3
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.11.14
npm ERR! peerinvalid Peer [email protected] wants karma@>=0.9

preprocessor does not support literate coffeescript, and discrepancies between running with coffee preprocessor and actually compiling the litcoffee files

It would be nice to get support for literate coffeescript. Currently, if there are literate comments in any of the code the preprocessor will treat them as code and throw compile errors.

The preprocessor also fails tests that are passed when the javascript is compiled already. I've tried to figure out why, and haven't been able to. I thought the best way to get your attention was to raise an issue.

Correct line numbers for CLI

running karma start karma.conf from the CLI incorrectly states the line number/file:

    TypeError: 'undefined' is not a function (evaluating 'escape(value)')
        at http://localhost:9876/base/app/scripts/services/webstorage.js?1380664051000:36
        at http://localhost:9876/base/test/spec/services/webstorage.js?1380664031000:23
        at http://localhost:9876/base/test/spec/services/webstorage.js?1380664031000:99
PhantomJS 1.9.2 (Mac OS X): Executed 72 of 72 (1 FAILED) (0.343 secs / 0.254 secs)

Where it should show the line number from the coffee script file.

Is there something I should be doing to get the correct info or is this a bug?

transformPath in Readme is wrong?

I may be completely misunderstanding how things work. The sample config in the README shows transformPath as:

      transformPath: function(path) {
        return path.replace(/\.js$/, '.coffee');
      }

However, it seems like the .js and .coffee are swapped. Using it this way I get a lot of Uncaught SyntaxErrors from Karma for each coffeescript file. If I switch it around (or just leave it out completely), then things just work. Should it be like this (or am I confused?):

      transformPath: function(path) {
        return path.replace(/\.coffee$/, '.js');
      }

Publish new version

Hi,

Is there a reason why the loosened coffeescript dependency that was commited to in ed41be7 has not been packaged and released yet?

Cheers,
T.

Source maps support

Based on #4

I believe there are two options:

  • add comment //# sourceMappingURL=/path/to/file.js.map
  • add header X-SourceMap: /path/to/file.js.map

Error - Can not load "coffee", it is not registered!

I installed the plugin with the command ; npm install --save-dev karma-coffee-preprocessor
I then configured my test config file as follows:

module.exports = function(config) {
  config.set({

    basePath: '',
    frameworks: ['jasmine'],
    files: [
        '../bower_components/angular/angular.js',
        '../bower_components/angular-ui-router/release/angular-ui-router.js',
        '../bower_components/angular-mocks/angular-mocks.js',
        '../src/scripts/**/*.coffee',
        'unit-tests/**/*.js'
    ],

    exclude: [
    ],

    preprocessors: {
        '../src/scripts/**/*.coffee': ['coffee']
    },

    coffeePreprocessor: {
      options: {
        bare: true,
        sourceMap: false
      },
      transformPath: function(path) {
        return path.replace(/\.coffee$/, '.js')
      }
    },

    reporters: ['progress'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_DEBUG,
    autoWatch: true,
    browsers: ['PhantomJS'],
    singleRun: false,
    concurrency: Infinity
  })
}

But when I try to start my test I have this error :

 Can not load "coffee", it is not registered!
  Perhaps you are missing some plugin?
/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:9
      throw error('No provider for "' + name + '"!');
      ^

Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
    at error (/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:22:12)
    at Object.parent.get (/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:9:13)
    at get (/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:54:19)
    at /opt/node/lib/node_modules/karma/lib/server.js:138:20
    at Array.forEach (native)
    at Server._start (/opt/node/lib/node_modules/karma/lib/server.js:137:21)
    at invoke (/opt/node/lib/node_modules/karma/node_modules/di/lib/injector.js:75:15)
    at Server.start (/opt/node/lib/node_modules/karma/lib/server.js:102:18)
    at Object.exports.run (/opt/node/lib/node_modules/karma/lib/cli.js:243:26)
    at Object.<anonymous> (/opt/node/lib/node_modules/karma/bin/karma:3:23)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:146:18)


Can anyone help me ?

Line number for coffee script tests are incorrect

Hi, can anyone help me to setup karma to show error line numbers correctly for CoffeScript tests?

For the following test the report contains text test_spec.coffee:3:26. I assume that 3 is the line number, which is not quite right. It should be 2, not 3.

describe 'test', ->
  it 'fails', -> expect(false).toBe true

Test output:

Chrome 30.0.1599 (Mac OS X 10.8.4) test fails FAILED
    Expected false to be true.
    Error: Expected false to be true.
        at null.<anonymous> (...test_spec.coffee:3:26)

My config:

preprocessors: {
  '**/*.coffee': ['coffee']
},
coffeePreprocessor: {
  options: {
    bare: true,
    sourceMap: true
  },
  transformPath: function(path) {
    return path.replace(/\.js$/, '.coffee');
  }
}

I am using:
[email protected]
[email protected]
[email protected]

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.