Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

broccoli-test-builder

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-test-builder

build a conventional test tree

latest
Source
npmnpm
Version
0.4.0
Version published
Weekly downloads
49
-90.2%
Maintainers
2
Weekly downloads
 
Created
Source

broccoli-test-builder

A broccoli plugin to build a tree that includes everything necessary to run tests.

Uses broccoli-lint-eslint to run jshint over the src code and test code.

Builds test files into amd modules and concats them into tests/built-amd-tests.js

Transpiles test files from es6 into es5.

Includes an amd loader, qunit.js, qunit.css, and a test-loader. Bring your own tests/index.html.

Assumes:

  • source code is in lib/ (if not, specify a different path with options.libDirName)
  • source code is in es6 format, suitable for transpiling with babel
  • test code is in tests/
  • an index.html exists in tests/

Usage:

var testBuilder = require('broccoli-test-builder');

var options = {
  libDirName: 'path-to-your-lib-dir', // default: 'lib'
};
var testTree = testBuilder.build();

/*
 testTree looks like:
/tests
├── built-amd-tests.js
├── index.html
├── loader.js
│   └── loader.js
├── qunit
│   ├── qunit.css
│   └── qunit.js
└── test-loader
    └── test-loader.js
*/

This is intended to be used with a test index.html that looks like the following. The capitalized variable markers will be replaced with the correct output.

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>YOUR TEST TITLE</title>

  @@QUNIT_CSS
</head>
<body>

  @@QUNIT_DOM

  @@QUNIT_JS

  <script src="/testem.js"></script>

  @@LOADER_JS
  <script src="../amd/YOUR-BUILT-AMD-CODE.js"></script>

  @@AMD_TEST_JS
  @@TEST_LOADER_JS
</body>
</html>

Keywords

broccoli-plugin

FAQs

Package last updated on 30 Jun 2017

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