azer / prova

Test runner based on Tape and Browserify
Other
333 stars 30 forks source link

Coffeeify transform running twice in browser when "browserify" field is defined in package.json #21

Open ahutchings opened 10 years ago

ahutchings commented 10 years ago

My source files are written in CoffeeScript, and I have the coffeeify transform registered under the browserify.transform field in package.json. When I run prova with the --browser flag, I get an error that seems to indicate that the transform is being run twice. If I remove the browserify field from package.json things work fine.

The error:

var MyTestClass, test;
^
ParseError: reserved word "var"
azer commented 10 years ago

looks like we'll have to remove automatically enabled transforms

azer commented 10 years ago

any opinions @unc0 ?

unc0 commented 10 years ago

But I added browserify.transform field to my gorillascript project's package.json then run my prova tests, the browser test works fine in prova v1.6.0 and v1.13.0.

https://gist.github.com/unc0/42a6cdd91f498a797ec8

azer commented 10 years ago

@unc0 thanks for the comment, I haven't actually tried myself, it might be a userland error then

regular commented 10 years ago

Removing automagical transforms seems like a cleaner approach anyway though.

azer commented 10 years ago

@regular yeah, agree

MylesBorins commented 10 years ago

Users are probably expecting the transforms in their Package.json to be run during tests though... seems that most likely you would most likely want to just dedupe transforms. You would perhaps also want to run the users transforms first. We experienced some grief with this an cssify.

That being said, you could argue that you should explicitly test your transforms in the command... just seems like extra work.

paulyoung commented 9 years ago

I found this thread after running into the same issue with grunt-browserify

I was hoping to employ the same fix as https://github.com/nikku/karma-browserify/issues/130 but after experimenting with the configure and preBundleCB options of grunt-browserify it appears that the transforms are empty at that point and so cannot be cleared out.