Giter Site home page Giter Site logo

grunt-qunitnode's Introduction

grunt-qunitnode Build Status: Linux

A Grunt task plugin to execute QUnit tests in Node.js.

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-qunitnode --save-dev

Using

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks( 'grunt-qunitnode' );

grunt.initConfig({
	qunitnode: {
		src: [ "test/mylib_test_a.js", "test/mylib_test_b.js" ]
	}
});

Source/Test Files

You should call your test files here. As in Node you can require the files to be tested in your test files, it's not necessary to load those via grunt. Otherwise, simply add them first.

This next example calls the source file that will be tested as well:

grunt.initConfig({
	qunitnode: {
		all: [ "src/mymodule.js", "test/mymodule.js" ]
	}
});

Globbing Patterns a.k.a. Wildcards

This plugin support Grunt Globbing Patterns, as seen in the example below:

// Project configuration.
grunt.initConfig({
	qunitnode: {
		all: [ "test/**/*.js" ]
	}
});

Node QUnit task

Run this task with the grunt qunitnode command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options

force

Type: boolean Default: false

When true, the whole task will not fail when there are individual test failures, or when no assertions for a test have run. This can be set to true when you always want other tasks in the queue to be executed.

grunt-qunitnode's People

Contributors

jamesmgreene avatar leobalter avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

leobalter krinkle

grunt-qunitnode's Issues

Loaded modules path is wrong

I've been playing around with this module and found some errors.

This one occurs when I try to load a test file in grunt. It tries to get the file from the plugin folder.

$ grunt
Running "qunitnode:files" (qunitnode) task
Testing test/diff.js Warning: Cannot find module '/Users/leobalter/dev/balterDiff/node_modules/grunt-qunitnode/test/diff.js' Use --force to continue.

Below is the code piece of my Gruntfile:

grunt.initConfig({
    qunitnode: {
        files: [ "test/diff.js" ]
    }
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.