☕️ Classic, reliable, trusted test framework for Node.js and the browser
feat!: cleanup references of --compilers (#5403)
Samuel Henriquef75d150cf611
diff --git a/lib/cli/run.js b/lib/cli/run.jsindex 631170c0..111b40de 100644--- a/lib/cli/run.js+++ b/lib/cli/run.js@@ -342,13 +342,6 @@ exports.builder = (yargs) =>}}- if (argv.compilers) {- throw createUnsupportedError(- `--compilers is DEPRECATED and no longer supported.- See https://github.com/mochajs/mocha/wiki/compilers-deprecation for migration information.`,- );- }-return true;}).middleware(async (argv, yargs) => {diff --git a/test/integration/fifo.spec.js b/test/integration/fifo.spec.jsindex 6883fb64..f2f7e863 100644--- a/test/integration/fifo.spec.js+++ b/test/integration/fifo.spec.js@@ -1,31 +1,39 @@-'use strict';+"use strict";-const assert = require('node:assert/strict');-const { execSync } = require("node:child_process");-const { createReadStream, createWriteStream, mkdtempSync, unlinkSync } = require("node:fs");-const { join } = require("node:path");-const { tmpdir } = require("node:os");+const assert = require("node:assert/strict");+const { execSync } = require("node:child_process");+const {+ createReadStream,+ createWriteStream,+ mkdtempSync,+ unlinkSync,+} = require("node:fs");+const { join } = require("node:path");+const { tmpdir } = require("node:os");const { invokeMocha, toJSONResult } = require("./helpers");describe("FIFO support", function () {it("should accept a test passed as a FIFO", function (done) {const dir = mkdtempSync(join(tmpdir(), "mocha-test-fifo-"));- const fifoPath = join(dir, 'fifo-1');+ const fifoPath = join(dir, "fifo-1");execSync(`mkfifo ${fifoPath}`);const writer = createWriteStream(fifoPath);- writer.on('ready', () => {- writer.write(`+ writer.on("ready", () => {+ writer.write(+ `describe('suite from FIFO', () => {it('should pass', () => true);});- `, (err) => {- if(!err) writer.end();- });+ `,+ (err) => {+ if (!err) writer.end();+ },+ );});- const args = ['--reporter', 'json', fifoPath];+ const args = ["--reporter", "json", fifoPath];invokeMocha(args,@@ -35,10 +43,10 @@ describe("FIFO support", function () {try {const result = toJSONResult(res);assert.equal(result.code, 0);- assert.equal(result.stats.suites, 1);- assert.equal(result.stats.tests, 1);- assert.equal(result.stats.passes, 1);- assert.equal(result.stats.pending, 0);+ assert.equal(result.stats.suites, 1);+ assert.equal(result.stats.tests, 1);+ assert.equal(result.stats.passes, 1);+ assert.equal(result.stats.pending, 0);assert.equal(result.stats.failures, 0);// Node hangs if FIFO is never unlinked.diff --git a/test/integration/options/compilers.spec.js b/test/integration/options/compilers.spec.jsdeleted file mode 100644index 93354b57..00000000--- a/test/integration/options/compilers.spec.js+++ /dev/null@@ -1,21 +0,0 @@-"use strict";--var helpers = require("../helpers");-var invokeMocha = helpers.invokeMocha;--describe("--compilers", function () {- it("should report deprecation", function (done) {- invokeMocha(- ["--compilers", "coffee:coffeescript/register"],- function (err, res) {- if (err) {- return done(err);- }-- expect(res, "to have failed with output", /compilers is deprecated/i);- done();- },- "pipe",- );- });-});