Skip to content

Test helpers for BroccoliPlugins that make testing build and rebuild behavior dead simple and expect diff friendly.

Notifications You must be signed in to change notification settings

sbonasu/broccoli-test-helper

 
 

Repository files navigation

broccoli-test-helper

Test helpers for BroccoliPlugins that make testing build and rebuild behavior dead simple and diff friendly.

Has TypeScript declarations and supports async/await style testing.

Build status Build Status

Usage Examples

QUnit and TypeScript

Example works in Node 4+ by using tsc -t ES2015 -m commonjs to compile async/await to generator wrapped in a helper.

import { createBuilder, createTempDir } from "broccoli-test-helper";
import Herp2Derp = require("../index");

QUnit.module("Herp2Derp", () => {
  QUnit.test("test build", async assert => {
    const input = await createTempDir();
    try {
      const subject = new Herp2Derp(input.path());
      const output = createBuilder(subject);
      try {
        // INITIAL
        input.write({
          "a.herp": "A",
          lib: {