(
/** @type {string} */ name,
/** @type {EXPECTED_ANY} */ config,
/** @type {(msg: string) => void} */ fn,
/** @type {unknown} */ only = undefined
)
| 4 | |
| 5 | describe("Validation", () => { |
| 6 | const createTestCase = ( |
| 7 | /** @type {string} */ name, |
| 8 | /** @type {EXPECTED_ANY} */ config, |
| 9 | /** @type {(msg: string) => void} */ fn, |
| 10 | /** @type {unknown} */ only = undefined |
| 11 | ) => { |
| 12 | it(`should fail validation for ${name}`, () => { |
| 13 | try { |
| 14 | const webpack = require(".."); |
| 15 | |
| 16 | webpack(config); |
| 17 | } catch (err) { |
| 18 | if (/** @type {EXPECTED_ANY} */ (err).name !== "ValidationError") { |
| 19 | throw err; |
| 20 | } |
| 21 | fn(/** @type {Error} */ (err).message); |
| 22 | |
| 23 | return; |
| 24 | } |
| 25 | |
| 26 | throw new Error("Validation didn't fail"); |
| 27 | }); |
| 28 | }; |
| 29 | |
| 30 | const createTestCaseOnlyValidate = ( |
| 31 | /** @type {string} */ name, |
no test coverage detected