Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-testem-all

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-testem-all

Grunt task for testem.js

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

grunt-testem-all

Grunt task for testem.js

Getting Started

This plugin requires Grunt ~0.4.5

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-testem-all --save-dev

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

grunt.loadNpmTasks('grunt-testem-all');

The "testem" task

Overview

In your project's Gruntfile, add a section named testem to the data object passed into grunt.initConfig().

grunt.initConfig({
  testem: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});

Options

grunt-testem-all supports all Testem options. See testem configuration reference.
As testem configuration has all necessary options for files serving, you don't need to configure any grunt file mapping — all you need is options field in your targets.

Running tasks

Tasks can be run with one of the optional flags:

  • --dev — run in dev mode (default)
  • --ci — run in ci mode
  • --server — run in server mode
  • --launchers — show launchers list
Note on --launchers

It shows launchers based on specific options.
grunt testem --launchers will show launchers list based on global options, grunt testem:target --launchers will show launchers list for specific target.

Options priority

Testem config files has higher priority.
Task options does not overrides global options from config file, but adds absent properties.
For example:

// testem.json
{
    "framework": "mocha"
    "launch_in_dev": ["Chrome"]
}

// Gruntfile
testem: {
    options: {
        launch_in_dev: ["FireFox"],
        port: 3333
    }
    ...
}

In result launch_in_dev property will be ["Chrome"], but port options will be added.

If you have testem config file in root of your project, it will be used as global config, even if you don't provide a path to config in options

Usage Examples

grunt.initConfig({
    testem: {
        options: {
            launch_in_dev: ["Chrome"],
            framework: 'mocha'
        },
    component: {
        options: {
            test_page: 'test/test_page.html',
            src_files:[
                'test/component.test.js'
            ]
		}
    },
    anotherComponent: {
        // this options overrides global task options
        options: {
            launch_in_dev: ["FireFox"],

            test_page: 'test/another_test_page.html',
            src_files:[
                'test/anotherComponent.test.js'
            ]
		}
    }
  }
});

Run task

grunt testem:component // run component target in dev mode
grunt testem:anotherComponent --ci // run anotherComponent target in ci mode

Keywords

FAQs

Package last updated on 22 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc