From bfc4ce40d87db0437198a136fa1710d4377303c5 Mon Sep 17 00:00:00 2001 From: Stephen Li Date: Sun, 24 Apr 2022 18:51:20 -0400 Subject: [PATCH] Warn validation errors when not testing --- src/webpack/QuasarUnusedPluginOptions.ts | 1 + tests/setup.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/webpack/QuasarUnusedPluginOptions.ts b/src/webpack/QuasarUnusedPluginOptions.ts index 3b695f7..2d69cdb 100644 --- a/src/webpack/QuasarUnusedPluginOptions.ts +++ b/src/webpack/QuasarUnusedPluginOptions.ts @@ -39,6 +39,7 @@ const validator = ajv.compile({ export function validateQuasarUnusedPluginOptions(options: unknown): options is Required { const isValid = validator(options) if (!isValid) { + console.warn('Invalid QuasarUnusedPluginOptions', validator.errors) throw new Error('Invalid QuasarUnusedPluginOptions') } diff --git a/tests/setup.ts b/tests/setup.ts index e69de29..29f5c8a 100644 --- a/tests/setup.ts +++ b/tests/setup.ts @@ -0,0 +1,8 @@ +// eslint-disable-next-line @typescript-eslint/no-empty-function +console.debug = () => {} + +// eslint-disable-next-line @typescript-eslint/no-empty-function +console.info = () => {} + +// eslint-disable-next-line @typescript-eslint/no-empty-function +console.warn = () => {}