<commit_before>[Grunt homepage](https://github.com/cowboy/grunt) | [Documentation table of contents](toc.md)

# qunit (built-in task)
Run [QUnit][qunit] unit tests in a headless [PhantomJS][phantom] instance.

[qunit]: http://docs.jquery.com/QUnit
[phantom]: http://www.phantomjs.org/

## About

This task is a [multi task](tasks_creating.md), meaning that grunt will automatically iterate over all `qunit` targets if a target is not specified.

_Need some help getting started with grunt? See the [configuring grunt](configuring.md) page._

## Project configuration

This example [gruntfile](configuring.md) shows a brief overview of the [config](api_config.md) properties used by the `qunit` task. For a more in-depth explanation, see the usage examples.

```javascript
exports.config = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Lists of files or URLs to be unit tested with QUnit.
    qunit: {},
  });

};
```

## Usage examples

### Wildcards

In this example, `grunt qunit` will test all `.html` files in the test directory. First, the wildcard is expanded to match each individual file. Then, each matched filename is converted to the appropriate `file://` URI. Finally, [QUnit][qunit] is run for each URI.

```javascript
exports.config = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    qunit: {
      all: ['test/*.html']
    }
  });

};
```

With a slight modification, `grunt qunit` will test all `.html` files in the test directory _and all subdirectories_. See the [minimatch](https://github.com/isaacs/minimatch) module's documentation for more details on wildcard patterns.<commit_msg>More docs.<commit_after>[Grunt homepage](https://github.com/cowboy/grunt) | [Documentation table of contents](toc.md)

# qunit (built-in task)
Run [QUnit][qunit] unit tests in a headless [PhantomJS][phantom] instance.

[qunit]: http://docs.jquery.com/QUnit
[phantom]: http://www.phantomjs.org/

## About

This task is a [multi task](tasks_creating.md), meaning that grunt will automatically iterate over all `qunit` targets if a target is not specified.

_Need some help getting started with grunt? See the [configuring grunt](configuring.md) page._

## Project configuration

This example [gruntfile](configuring.md) shows a brief overview of the [config](api_config.md) properties used by the `qunit` task. For a more in-depth explanation, see the usage examples.

```javascript
exports.config = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    // Lists of files or URLs to be unit tested with QUnit.
    qunit: {}
  });

};
```

## Usage examples

### Wildcards

In this example, `grunt qunit` will test all `.html` files in the test directory. First, the wildcard is expanded to match each individual file. Then, each matched filename is converted to the appropriate `file://` URI. Finally, [QUnit][qunit] is run for each URI.

```javascript
exports.config = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    qunit: {
      all: ['test/*.html']
    }
  });

};
```

With a slight modification, `grunt qunit` will test all `.html` files in the test directory _and all subdirectories_. See the [minimatch](https://github.com/isaacs/minimatch) module's documentation for more details on wildcard patterns.
{'fraction_non_alphanumeric': 0.11736237144585603, 'fraction_numerical': 0.0, 'mean_word_length': 4.240887480190175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3903316', 'n_tokens_mistral': 1004, 'n_tokens_neox': 970, 'n_words': 370}