Comments (5)
Interesting, I have not seen this error. Could you post your karma-config file somewhere? Also, can you run your karma suite in debug mode (--log-level debug
) and post the logs here?
from karma-parallel.
Hi joeljeske, thank you for coming back to promptly. Here is the karma-config file:
As for the logs - do you mean simply copy paste log info from the console, or is there a file somewhere that karma dumps all the logs? Sorry for the last part, I don't use karma very often.
module.exports = function(config) {
config.set({
basePath: './',
frameworks: ['parallel', 'jasmine'],
files: [
'node_modules/babel-polyfill/browser.js',
{ pattern: 'karma-test-shim.ts', watched: false },
{ pattern: 'src/**/*.spec.ts', watched: true }
],
exclude: [],
preprocessors: {
'**/*.ts': ['webpack']
},
reporters: ['progress', 'bamboo'],
port: 1111,
colors: true,
customLaunchers: {
ChromeCustom: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
browsers: ['ChromeCustom'],
singleRun: true,
concurrency: Infinity,
webpack: require('./webpack-karma.config'),
webpackMiddleware: {
noInfo: true
},
plugins: [
require('karma-parallel'),
require('karma-bamboo-reporter'),
require('karma-webpack'),
require('karma-chrome-launcher'),
require('karma-jasmine')
],
parallelOptions: {
executors: 4, // Defaults to cpu-count - 1
shardStrategy: 'round-robin'
// shardStrategy: 'description-length'
},
mime: { 'text/x-typescript': ['ts', 'tsx'] }
});
};
from karma-parallel.
I just mean copying and pasting the stdout/err here. Passing the That debug flag provides more useful information
from karma-parallel.
I have gotten the same error.
HeadlessChrome 67.0.3396 (Ubuntu 0.0.0) ERROR
Uncaught SyntaxError: Unexpected token % in JSON at position 0
at http://localhost:9876/context.html:1
HeadlessChrome 67.0.3396 (Ubuntu 0.0.0) ERROR
Uncaught SyntaxError: Unexpected token % in JSON at position 0
at http://localhost:9876/context.html:1
HeadlessChrome 67.0.3396 (Ubuntu 0.0.0) ERROR
Uncaught SyntaxError: Unexpected token % in JSON at position 0
at http://localhost:9876/context.html:1
HeadlessChrome 67.0.3396 (Ubuntu 0.0.0) ERROR
Uncaught SyntaxError: Unexpected token % in JSON at position 0
at http://localhost:9876/context.html:1
HeadlessChrome 67.0.3396 (Ubuntu 0.0.0) ERROR
Uncaught SyntaxError: Unexpected token % in JSON at position 0
at http://localhost:9876/context.html:1
HeadlessChrome 67.0.3396 (Ubuntu 0.0.0) ERROR
Uncaught SyntaxError: Unexpected token % in JSON at position 0
at http://localhost:9876/context.html:1
HeadlessChrome 67.0.3396 (Ubuntu 0.0.0) ERROR
Uncaught SyntaxError: Unexpected token % in JSON at position 0
at http://localhost:9876/context.html:1
Finished in 7.806 secs / 0 secs @ 09:48:25 GMT+0300 (IDT)
SUMMARY:
✔ 0 tests completed
No type errors found
Version: typescript 3.0.1
Time: 34245ms
From some investigation, it falls on web initial file loading script
https://github.com/joeljeske/karma-parallel/blob/master/lib/karma-parallelizer.js#L155
The %KARMA_SHARD_INFO%
variable was not replaced so it understandable why json.parse
failed.
It seems the beforeMiddleware
is not executed
https://github.com/joeljeske/karma-parallel/blob/master/lib/middleware.js#L39
I traced in back to our karma version which was a very old one that did not have support for before middlewares
. After updating Karma to the latest version ( > 2.0) this error was resolved.
from karma-parallel.
Yes, we do not support karma < v1. I have added an explicit peer dependency to ensure awareness when installing the package.
Thanks!
from karma-parallel.
Related Issues (20)
- karma-parallel do not return exit code 1 anymore on too low code coverage HOT 7
- Exception when using "karma run" HOT 7
- Should fail the test cases split to a browser that is disconnected HOT 4
- Aggregated Log Output HOT 10
- No support for Circle CI HOT 2
- Support Karma 4 HOT 1
- When browser disconnects, remaining tests are skipped HOT 5
- Random failures with uncaught errors and missing tests
- Jasmine test timeout is ignored HOT 1
- Random test failures during CI process
- How to enable running tests in parallel on CI
- Publish new version HOT 2
- No calculation of all passed tests on kubernetis -job
- Script Error while executing karma tests HOT 1
- Only supporting Jasmine ?
- Karma parallel cannot find any tests after starting Chrome
- Need help to get code coverage HOT 3
- `Parallel` throws away global beforeEach in multi-browser mode
- Is there a way to let what files to run in what threads/browser instances ?
- failSpecWithNoExpectations to true in jasmine and karma-parallel add the extra tests HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-parallel.