Open AlexisBarta opened 8 years ago
You also need karma-babel-preprocessor
to work with ES6 via Karma.
https://github.com/babel/karma-babel-preprocessor
I forgot to put my test file
"use strict";
import BootstrapFormView from "../src/js/views/BootstrapFormView.js";
describe("BootstrapFormView", function() {
var bootstrapFormView = new BootstrapFormView();
it("can convert error strings to errors", function() {
var errorString = "|This is an error message";
expect(bootstrapFormView.errorStringToErrors(errorString)).toBe("This is an error message");
});
});
I installed karma-babel-preprocessor
and added it to the plugging list and I still have the same issue.
I'm running into this issue too. Was there any resolution?
I also have the same issue. Is there no solution out there?
Sorry guys I can't help much cause I'm using Webpack now.
I'm also having this issue. Anyone resolve this?
@AlexisBarta I have also this error under Webpack with Karma :/, do you have to ? or did you have find a trick to fix it ? Thank you
@AlexisBarta using webpack
and babel
you should be able to transpile the ES6.
preprocessors: { 'tests/jasmine/**/*.js': ['webpack','babel'] }
I have the following error :
Uncaught SyntaxError: Unexpected token import at path/test/BootStrapFormView.Test.js:3
Here my Karma configuration file and my package.json
karma.conf.js
package.json