(
/** @type {string} */ name,
/** @type {EXPECTED_ANY} */ config
)
| 51 | }; |
| 52 | |
| 53 | const createTestCaseWithoutError = ( |
| 54 | /** @type {string} */ name, |
| 55 | /** @type {EXPECTED_ANY} */ config |
| 56 | ) => { |
| 57 | it(`should success validation for ${name}`, () => { |
| 58 | let errored; |
| 59 | |
| 60 | try { |
| 61 | const webpack = require(".."); |
| 62 | |
| 63 | webpack(config); |
| 64 | } catch (err) { |
| 65 | if (/** @type {EXPECTED_ANY} */ (err).name === "ValidationError") { |
| 66 | throw new Error("Validation didn't success", { |
| 67 | cause: /** @type {Error} */ (err) |
| 68 | }); |
| 69 | } |
| 70 | |
| 71 | errored = err; |
| 72 | |
| 73 | return; |
| 74 | } |
| 75 | |
| 76 | if (errored) { |
| 77 | throw new Error("Validation didn't success"); |
| 78 | } |
| 79 | }); |
| 80 | }; |
| 81 | |
| 82 | createTestCase("undefined configuration", undefined, (msg) => |
| 83 | expect(msg).toMatchInlineSnapshot(` |
no test coverage detected