8

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
jacksondc
  • 600
  • 1
  • 6
  • 19
eguneys
  • 6,028
  • 7
  • 31
  • 63

1 Answers1

5

Since your posting, Karma has added an option to specify a custom HTML file. The property is called customContextFile

example

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
            }
        ]
    })
}

read more

pull request - https://github.com/karma-runner/karma/pull/1825

docs - http://karma-runner.github.io/1.0/config/configuration-file.html#

user2954463
  • 2,362
  • 2
  • 23
  • 37
  • 2
    Are there any documentations about the rules for customizing a context file? – LCB Jun 13 '17 at 16:34
  • 1
    I don't see anything in the docs about rules for customizing a context file. You could view an example by looking at karma's own context.html file. I get the sense that most people do not use this config option. https://github.com/karma-runner/karma/blob/master/static/context.html – user2954463 Jun 13 '17 at 17:13