1. karma-qunit
A Karma plugin. Adapter for QUnit testing framework.
karma-qunit
Package: karma-qunit
Created by: karma-runner
Last modified: Tue, 13 Feb 2024 15:39:58 GMT
Version: 4.2.0
License: MIT
Downloads: 144,487
Repository: https://github.com/karma-runner/karma-qunit

Install

npm install karma-qunit
yarn add karma-qunit

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.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin