(
/** @type {string} */ name,
/** @type {EXPECTED_ANY} */ config,
/** @type {(msg: string) => void} */ fn
)
| 28 | }; |
| 29 | |
| 30 | const createTestCaseOnlyValidate = ( |
| 31 | /** @type {string} */ name, |
| 32 | /** @type {EXPECTED_ANY} */ config, |
| 33 | /** @type {(msg: string) => void} */ fn |
| 34 | ) => { |
| 35 | it(`should fail validation for ${name}`, () => { |
| 36 | try { |
| 37 | const webpack = require(".."); |
| 38 | |
| 39 | webpack.validate(config); |
| 40 | } catch (err) { |
| 41 | if (/** @type {EXPECTED_ANY} */ (err).name !== "ValidationError") { |
| 42 | throw err; |
| 43 | } |
| 44 | fn(/** @type {Error} */ (err).message); |
| 45 | |
| 46 | return; |
| 47 | } |
| 48 | |
| 49 | throw new Error("Validation didn't fail"); |
| 50 | }); |
| 51 | }; |
| 52 | |
| 53 | const createTestCaseWithoutError = ( |
| 54 | /** @type {string} */ name, |
no test coverage detected