Karma has a built-in context.html
file that loads up the test
page. But it sucks. Can I specify a custom test page?
The reason I am asking is because I want to see the mocha pretty interface on the browser. Is there a way to insert that with Karma?
Testem displays the test framework's interface on the browser; is there a reason why Karma displays nothing but an ugly blank page?
@stackoverflow = are you happy now?yes:no
stackoverflow = happy now?ok:thanks
Simply add the browsers you would like to capture into the configuration file. Then, Karma will take care of auto-capturing these browsers, as well as killing them after the job is over.
Jasmine is the framework we are going to use to create our tests. It has a bunch of functionalities to allow us the write different kinds of tests. karma. Karma is a task runner for our tests.
The property singleRun controls how Karma executes, if set to true , Karma will start, launch configured browsers, run tests and then exit with a code of either 0 or 1 depending on whether or not all tests passed.
Since your posting, Karma has added an option to specify a custom HTML file. The property is called customContextFile
module.exports = {
config.set({
basePath: './',
frameworks: ['jasmine'],
reporters: ['dots'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browserNoActivityTimeout: 100000,
plugins: [
'karma-chrome-launcher',
'karma-jasmine'
],
customContextFile: 'specRunner.html',
files: [
{
pattern: 'dist/tests/*.specs.js',
served: true,
watched: true
}
]
})
}
pull request - https://github.com/karma-runner/karma/pull/1825
docs - http://karma-runner.github.io/1.0/config/configuration-file.html#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With