Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

855 B
Raw Blame
"use strict";

var helpers = require("../helpers.cjs");
var runMochaAsync = helpers.runMochaAsync;

describe("--jobs", function () {
  describe("when set to a number less than 2", function () {
    it("should run tests in serial", function () {
      return expect(
        runMochaAsync(
          "options/jobs/fail-in-parallel.fixture.cjs",
          ["--parallel", "--jobs", "1"],
          "pipe",
        ),
        "when fulfilled",
        "to have passed",
      );
    });
  });

  describe("when set to a number greater than 1", function () {
    it("should run tests in parallel", function () {
      return expect(
        runMochaAsync(
          "options/jobs/fail-in-parallel.fixture.cjs",
          ["--parallel", "--jobs", "2"],
          "pipe",
        ),
        "when fulfilled",
        "to have failed",
      );
    });
  });
});