-
Notifications
You must be signed in to change notification settings - Fork 50
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
How to add System into Karma #181
Comments
You haven't mentioned versions of karma, or karma-jspm, or posted your karma.conf file... |
Karma 1.4.1 module.exports = function (config) {
config.set({
autoWatch: false,
singleRun: true,
browserNoActivityTimeout: 130000,
frameworks: ['jspm', 'jasmine-ajax', 'jasmine'],
jspm: {
config: './src/jspm.config.js',
loadFiles: [
'./src/test.spec.js',
],
serveFiles: [
'./src/**/!(*spec).js'
]
},
proxies: {
'/src/': '/base/src/',
'/': 'http://placehold.it/1x1', // stops the 404 issue
'/jspm_packages/': '/src/jspm_packages/'
},
browsers: ['PhantomJS'],
reporters: ['spec'],
specReporter: {
maxLogLines: 5, // limit number of lines logged per test
suppressErrorSummary: true, // do not print error summary
suppressFailed: false, // do not print information about failed tests
suppressPassed: false, // do not print information about passed tests
suppressSkipped: true, // do not print information about skipped tests
showSpecTiming: true // print the time elapsed for each spec
},
});
}; |
This plugin/adapter already injects SystemJS to the files array. The problem lies in the removal of system-polyfills, which causes an error in karma-jspm and -much worse- causes the main SystemJS script to error, because it uses Promise and PhantomJS doesn't support promises yet. Since this adapter will always add system.src.js as the first served file, there's no room to inject a promise polyfill into it. TL;DR: we're stuck with jspm 0.17.0-beta.32 for the time being, until @guybedford decides to re-add system polyfills, or phantomjs 2.5 is released (it allegedly support promises), or this adapter includes its own promise polyfill before system.src.js in the files array. The latter would have to be done after checking the existance of system-polyfills, to determine if we're dealing with SystemJS v20.* |
@amenadiel This post is very useful thanks. Looking over everything happening with SystemJS i'm not convinced it will be added back in. Hopefully like you said it gets added back in or this plugin will change so that a polyfill can be injected. |
@peteringram0 perhaps switching from Phantom to either SlimerJS or NightmareJS woudl help. Those two support promises natively. I couldn't make my tests pass with jasmine and nightmarejs, but it ran just like PhantomJS was supposed to run. |
@amenadiel what error was shown when you tried NightmareJS? I also tried that but it just says |
@ValeryIvanov I didn't dig much deeper into Nightmare. The tests that were passing under phantom failed on it, and I had no intention to debug them |
There's an open PR #187 that solves this issue |
Hey,
Im getting the following error:
The text was updated successfully, but these errors were encountered: