CrowdHailer / rollup-karma-jasmine-example

Calculator project that bundles es6-modules with Rollup. Tests use Jasmine and are run in the browser with Karma
BSD 2-Clause "Simplified" License
6 stars 1 forks source link

rolling up many specs #1

Open rDr4g0n opened 8 years ago

rDr4g0n commented 8 years ago

Can you extend your demo to show the cleanest way to rollup multiple spec files?

rDr4g0n commented 8 years ago

The solution I am trying now is to have a test.js that imports all of the individual spec files and making that the entrypoint. Something like:

"use strict";
// entrypoint for unit tests
import "myLibCore.spec.js";
import "SomeModule/someModule.spec.js";
import "AnotherModule/anotherModule.spec.js";
import "utils.spec.js";

But this adds another layer of effort for the dev who is adding tests for a new module. I am considering automating creation of this file before the test build begins.

Unfortunately, bundling everything using rollup has the added side effect of causing all of jasmine's failure messages in the console to be attributed to "test.js" instead of the individual spec file :(

mtrias commented 7 years ago

@rDr4g0n did you figure this out?

rDr4g0n commented 7 years ago

Unfortunately, my proposed workaround is the only solution i have found. I have moved to using webpack and there are a number of preconfigured webpack + test runner that work out of the box.

mtrias commented 7 years ago

Thanks rDr4g0n!

Your suggestion lead me to investigate how they do it in the Webpack world, which helped me to resolve the issues I was having.