mocha-qunit-ui

WebJar for mocha-qunit-ui

Лицензия

Лицензия

MIT
Категории

Категории

Github Инструменты разработки Контроль версий
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

github-com-jugglinmike-mocha-qunit-ui
Последняя версия

Последняя версия

0.1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

mocha-qunit-ui
WebJar for mocha-qunit-ui
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/jugglinmike/mocha-qunit-ui

Скачать github-com-jugglinmike-mocha-qunit-ui

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-jugglinmike-mocha-qunit-ui/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-jugglinmike-mocha-qunit-ui</artifactId>
    <version>0.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-jugglinmike-mocha-qunit-ui/
implementation 'org.webjars.npm:github-com-jugglinmike-mocha-qunit-ui:0.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-jugglinmike-mocha-qunit-ui/
implementation ("org.webjars.npm:github-com-jugglinmike-mocha-qunit-ui:0.1.3")
'org.webjars.npm:github-com-jugglinmike-mocha-qunit-ui:jar:0.1.3'
<dependency org="org.webjars.npm" name="github-com-jugglinmike-mocha-qunit-ui" rev="0.1.3">
  <artifact name="github-com-jugglinmike-mocha-qunit-ui" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-jugglinmike-mocha-qunit-ui', version='0.1.3')
)
libraryDependencies += "org.webjars.npm" % "github-com-jugglinmike-mocha-qunit-ui" % "0.1.3"
[org.webjars.npm/github-com-jugglinmike-mocha-qunit-ui "0.1.3"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Mocha QUnit UI

Build Status

An interface for Mocha that implements QUnit's API.

Mocha ships with a QUnit interface, but it lacks assertions, support for expected assertion count, and the asyncTest method (among other things). This is an alternate implementation that fully supports the entire QUnit API. It may be run either in Node.js or the browser. The goal is to get as close as possible to being able to run QUnit tests unaltered in Mocha.

Installation

$ npm install mocha-qunit-ui --save-dev

Usage

Node.js

From the command line:

$ mocha --ui mocha-qunit-ui test/test-file-1.js

Programatically:

// Load mocha-qunit-ui
require("mocha-qunit-ui");
// Tell mocha to use the interface.
var mocha = new Mocha({
  ui:"qunit"
});
// Add your test files
mocha.addFile("path/to/my/testfile.js");
// Run your tests
mocha.run(function(failures){
  process.exit(failures);
});

Browser environments

Declare an HTML file with the following markup to run tests in the browser:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Tests</title>
    <script src="path/to/mocha.js"></script>
    <script src="mocha-qunit-ui.js"></script>
    <script>
      mocha.setup({
        ui: "qunit"
      });
    </script>
    <link rel="stylesheet" type="text/css" href="path/to/mocha.css">
  </head>
  <body>
    <div id="mocha"></div>
    <script>
      module("On page test!");
      test("An awesome QUnit style test", 2, function () {
        ok(true);
        equal(1, parseInt("1"));
      });
      mocha.run();
    </script>
  </body>
</html>

You can also use qunit-mocha-ui from Grunt with the grunt-mocha task. Here's an example Gruntfile.js:

module.exports = function(grunt) {
  grunt.loadNpmTasks('grunt-mocha');
  grunt.initConfig({
    mocha: {
      test:{
        options:{
          mocha: {
            ui: 'qunit'
          }
        },
        src: [
          "test/test-file-1.js"
        ]
      }
    }
  });
  grunt.registerTask('default', ['mocha']);
};

Known differences from QUnit API

  • The global variable module is reserved in Node.js. If you want to define a QUnit module in that environment, use the QUnit.module alias.

Running tests

  1. Install dependencies: npm install
  2. Update QUnit submodule git submodule update --init --recursive
  3. npm test

You can run QUnit's test suite by opening test/qunit.html in a browser.

License

Copyright (c) 2013 Mike Pennisi
Licensed under the MIT license.

Версии библиотеки

Версия
0.1.3