Skip to content

armgit / mocha

Public Imported from GitHub
0

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

652 B
Raw Blame
"use strict";

var path = require("node:path").posix;
var helpers = require("../helpers.cjs");
var runMochaJSON = helpers.runMochaJSON;

describe("--sort", function () {
  var args = [];

  before(function () {
    args = ["--sort"];
  });

  it("should sort tests in alphabetical order", function (done) {
    var fixtures = path.join("options", "sort*.fixture.js");
    runMochaJSON(fixtures, args, function (err, res) {
      if (err) {
        done(err);
        return;
      }
      expect(res, "to have passed test count", 2).and(
        "to have passed test order",
        "should be executed first",
      );
      done();
    });
  });
});