Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

coffeescript rjs plugin prevents usage of karma for coffeescript tests #118

Open
eriktrom opened this issue Dec 15, 2013 · 0 comments
Open

Comments

@eriktrom
Copy link
Contributor

The tl;dr of this is that inside of a coffeescript test file you'll have something like the following(coffeescript only issue, fyi)

define(['cs!some-cs-module'], (SomeCsModule) ->
  ... do stuff with the required module... 

When loading this test file through the browser test runner, all good, happy dandy

But when this file is picked up by karma things go bad as the cs rjs plugin is bypassed and karma blows up

The temporary fix is to choose one or the other, karma tests or browser tests when using cs test files(this is not an issue when using javascript at all)

The permanent fix is to either run the file through the rjs cs plugin before karma reads the file OR find a karma plugin that will essentially do the same OR remove the cs! plugin and pre-compile cs test files... Pre-compiling should be a last resort, but if enough reasons to do so push us over the edge in that direction then the current grunt pipeline will need to change in a few significant ways(which i won't go into here, but all of them downgrade an otherwise awesome development experience and honestly thwart any upsides to using coffescript for testing in the first place, thus almost making this a null issue if rjs cs! plugin cannot be introduced into karma)

I've tried 6 ways to sunday to make this a non issue, but im pretty sure(pending adding rjs plugins to karma) that this will likely not be resolved unless we move to pre-compiling (therefore it's related to #117)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant