Skip to content

karma-runner/karma-qunit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d69d7b1 · Dec 4, 2024
Sep 13, 2024
Dec 16, 2021
Jul 20, 2018
Feb 9, 2024
Feb 3, 2021
Feb 9, 2024
Oct 21, 2015
Apr 4, 2019
Apr 4, 2019
Sep 13, 2024
Dec 17, 2021
Mar 29, 2023
Mar 19, 2013
Feb 3, 2021
Oct 23, 2013
Apr 8, 2023
Dec 4, 2024
Dec 16, 2021
Aug 19, 2024

Repository files navigation

karma-qunit

npm version Build Status js-standard-style npm downloads

Adapter for the QUnit testing framework.

Installation

The easiest way is to keep karma-qunit as a devDependency in your package.json by running

npm install karma-qunit --save-dev

Configuration

Add qunit in the frameworks array in your karma.conf.js file. Then, in the plugins array, add karma-qunit. The following code shows the default configuration:

// karma.conf.js
module.exports = function (config) {
  config.set({
    frameworks: ['qunit'],
    plugins: ['karma-qunit'],
    files: [
      '*.js'
    ]
  })
}

You can also pass options for QUnit.config (documented here) as such:

/// karma.conf.js
module.exports = function (config) {
  config.set({
    frameworks: ['qunit'],
    plugins: ['karma-qunit'],
    files: [
      '*.js'
    ],

    // client configuration
    client: {
      clearContext: false,
      qunit: {
        showUI: true,
        testTimeout: 5000
      }
    }
  })
}

Note: showUI: true needs the clearContext: false option to display correctly in non-debug mode.


For more information on Karma see the homepage. If you're using karma-qunit to test Ember.js, you might find Karma's Ember guide helpful.