karma-qunit:Karma插件。 QUnit测试框架适配器

  • c2_722603
    了解作者
  • 59.8KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-21 07:03
    上传日期
业力单位 测试框架的适配器。 安装 最简单的方法是通过运行将karma-qunit保留在package.json作为devDependency npm install karma-qunit --save-dev 配置 在您的karma.conf.js文件的frameworks数组中添加qunit 。 然后,在plugins数组中,添加karma-qunit 。 以下代码显示了默认配置: // karma.conf.js module . exports = function ( config ) { config . set ( { frameworks : [ 'qunit' ] , plugins : [ 'karma-qunit' ] , files : [ '*.js' ] } ) } 您还可以这样传递QUnit.co
karma-qunit-master.zip
  • karma-qunit-master
  • .github
  • workflows
  • test.yml
    522B
  • src
  • adapter.js
    3.2KB
  • adapter.wrapper
    479B
  • examples
  • simple
  • .eslintrc
    57B
  • test-with-fixture.js
    564B
  • karma.conf.js
    468B
  • test-with-lib.js
    123B
  • test.js
    96B
  • test
  • src
  • .eslintrc
    130B
  • adapter.spec.js
    6.6KB
  • mocks.js
    1.1KB
  • lib
  • .eslintrc
    37B
  • index.spec.js
    573B
  • lib
  • index.js
    492B
  • tasks
  • build.js
    613B
  • .eslintrc
    28B
  • .gitattributes
    43B
  • CONTRIBUTING.md
    186B
  • README.md
    2KB
  • .eslintignore
    15B
  • karma.conf.js
    466B
  • .gitignore
    37B
  • Gruntfile.js
    836B
  • package.json
    2.9KB
  • LICENSE
    1.1KB
  • package-lock.json
    172.2KB
内容介绍
# karma-qunit [![npm version](https://img.shields.io/npm/v/karma-qunit.svg?style=flat-square)](https://www.npmjs.com/package/karma-qunit) [![Build Status](https://img.shields.io/github/workflow/status/karma-runner/karma-qunit/Tests/master?style=flat-square)](https://github.com/karma-runner/karma-qunit/actions?workflow=Tests) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/karma-runner/karma-qunit) [![npm downloads](https://img.shields.io/npm/dm/karma-qunit.svg?style=flat-square)](https://www.npmjs.com/package/karma-qunit) > Adapter for the [QUnit](https://qunitjs.com/) testing framework. ## Installation The easiest way is to keep `karma-qunit` as a devDependency in your `package.json` by running ```bash 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: ```js // 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](https://api.qunitjs.com/config/QUnit.config)) as such: ```js /// 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](https://karma-runner.github.io/latest/plus/emberjs.html) helpful. [homepage]: https://karma-runner.github.com/
评论
    相关推荐