Closed piacenti closed 6 years ago
Ok so I commented out my custom webpack configuration //config.devtools="source-maps"
and now I'm getting this error:
23 10 2018 16:31:51.799:INFO [karma-server]: Karma v3.1.1 server started at http://0.0.0.0:9876/ 23 10 2018 16:31:51.801:INFO [launcher]: Launching browsers PhantomJS with concurrency unlimited 23 10 2018 16:31:51.824:INFO [launcher]: Starting browser PhantomJS 23 10 2018 16:31:52.119:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket lHhTSSIUKt8Q1Kw5AAAA with id 21493831 PhantomJS 2.1.1 (Linux 0.0.0) ERROR { "message": "ReferenceError: Can't find variable: Set\nat undefined:79", "str": "ReferenceError: Can't find variable: Set\nat undefined:79" }
Leaving config.devtool= "eval-source-map" has the same result
Changed my configuration to be more explicit
kotlinFrontend {
sourceMaps = true
npm {
dependency("react", "16.5.2")
dependency("react-dom", "16.5.2")
dependency("toastr", "2.1.4")
devDependency("karma")
devDependency("qunit")
}
webpackBundle {
bundleName = "app"
}
karma{
preprocessors = ["webpack",'sourcemap']
plugins = ["karma-webpack", "karma-phantomjs-launcher", "karma-junit-reporter", "karma-qunit", "karma-sourcemap-loader"]
}
}
And ended up finding out that the problem was in my unit test trying to instantiate a react component. The basic assertTrue(true) works fine
I have an multi-plataform application that runs without any issues. However, I'm trying to use the default karma integration to run unit tests but karma seems to be looking for the tests on the wrong places. It seems that it expects webpack to do something different than for the default application. Webpack just does the usual of creating app.bundle.js in the build/bundle folder.
I get this error when attempting to run tests:
Theses frontend_test.bundle.js files don't exist anywhere and I assume I would need additional webpack configurations to support it but the example projects don't have anything special done to support karma.
This is my configuration: