From 0460b18ad779667fb8b1a39aeee058d6b019553b Mon Sep 17 00:00:00 2001 From: Alhadis Date: Mon, 25 Feb 2019 10:18:07 +1100 Subject: [PATCH] Update Mocha configuration to use new "RC" format Here, "RC" refers explicitly to `.mocharc*` files, which were introduced in Mocha v6.0.0 as a replacement for the more limited mocha.opts format. See mochajs/mocha#3556. --- .mocharc.json | 4 ++++ test/basic-usage.js | 1 - test/duplicate-options.js | 1 - test/empty-input.js | 1 - test/mocha.opts | 1 - test/string-input.js | 3 +-- 6 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 .mocharc.json delete mode 100644 test/mocha.opts diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 0000000..7f09281 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,4 @@ +{ + "ui": "tdd", + "require": ["chai/register-assert"] +} diff --git a/test/basic-usage.js b/test/basic-usage.js index 982095e..5ad9897 100644 --- a/test/basic-usage.js +++ b/test/basic-usage.js @@ -1,7 +1,6 @@ "use strict"; const getOpts = require("../index.js"); -const {assert} = require("chai"); suite("Basic usage", () => { diff --git a/test/duplicate-options.js b/test/duplicate-options.js index c49075a..82d35cb 100644 --- a/test/duplicate-options.js +++ b/test/duplicate-options.js @@ -1,7 +1,6 @@ "use strict"; const getOpts = require("../index.js"); -const {assert} = require("chai"); suite("Duplicate option handling", () => { diff --git a/test/empty-input.js b/test/empty-input.js index 30518f5..3faa928 100644 --- a/test/empty-input.js +++ b/test/empty-input.js @@ -1,7 +1,6 @@ "use strict"; const getOpts = require("../index.js"); -const {assert} = require("chai"); suite("Empty input", () => { diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index 5efaf24..0000000 --- a/test/mocha.opts +++ /dev/null @@ -1 +0,0 @@ ---ui tdd diff --git a/test/string-input.js b/test/string-input.js index d7afbcc..03ed6db 100644 --- a/test/string-input.js +++ b/test/string-input.js @@ -1,7 +1,6 @@ "use strict"; const getOpts = require("../index.js"); -const {assert} = require("chai"); suite("String input", () => { @@ -153,7 +152,7 @@ suite("String input", () => { expect('"\\--foo"', {"--foo": ""}, {argv: ["\\--foo"], options: {}}); expect('"\\\\--foo"', {"--foo": ""}, {argv: ["\\--foo"], options: {}}); - // Assert that parsing esaped option-strings won't have affect arrays + // Assert that parsing escaped option-strings won't affect arrays expect(["\\--foo"], {"--foo": ""}, {argv: ["\\--foo"], options: {}}); expect(["\\ --foo"], {"--foo": ""}, {argv: ["\\ --foo"], options: {}}); expect(['"\\--foo"'], {"--foo": ""}, {argv: ['"\\--foo"'], options: {}});