-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Karma finishes unexpectedly with no output? #6
Comments
Actually I missed a cool part of rollup. Since I didn't refer to the imported source code it was removed ending up in a test without implementation. Once I referenced the source in a test it gets pulled in. |
Glad you were able to resolve your own issue :) 👍 |
@thepian Hi, I seem to be getting the same issue as you. Karma is finishing with no output, however even if I reference the imported code it still does not work. I suspect it has something to do with the es2015 class syntax, as removing classes allows karma to run. Here is a small example that reproduces my issue// test/foo_test.js
import Foo from "../src/foo";
describe("foo", () => {
it("bar", () => {
assert.equal(new Foo().bar(), "baz");
});
}); // src/foo.js
export default class Foo {
bar() {
return "baz";
}
} // karma.conf.js
module.exports = function(config) {
config.set({
basePath: "",
frameworks: ["mocha", "chai"],
files: [
"test/**/*_test.js"
],
preprocessors: {
"test/**/*_test.js": ["rollup"]
},
exclude: [],
rollupPreprocessor: {
rollup: {
plugins: [
require("rollup-plugin-node-resolve")(),
require("rollup-plugin-commonjs")({
exclude: ["src/**", "test/**/*.js"]
}),
require("rollup-plugin-babel")({
exclude: "node_modules/**",
presets: [require("babel-preset-es2015-rollup")],
babelrc: false
})
]
},
bundle: {
sourceMap: "inline"
}
},
reporters: ["progress"],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ["Chrome"],
singleRun: true,
concurrency: Infinity
});
}; |
I noticed an invalid configuration (specifically an invalid Also @jellymann, I know I'm late to the party but the error you describe is surely related to this one... seems to have been an issue with the specific combination of plug-ins you listed:
For what it's worth, I've had terrible luck combining Babel with Rollup... particularly in earlier versions of Node (where I suppose various ES2015 features aren't supported.) Related #4 |
Sorry in advance for a poor bug report.
I'm trying out the preprocessor and have it working without plugins, however it seems the rollup doesn't include the imports. I assume the Babel plugin is needed for things to work properly.
So I tried your example of adding
rollup-plugin-babel
, but when I do that the Karma server never takes off. There is no debug output, Karma just finishes.Do you have any suggestions for how to debug this?
The text was updated successfully, but these errors were encountered: