From 38c7da584dbf7c43a2531ce9ef7ec1d6f444ceb5 Mon Sep 17 00:00:00 2001 From: Christian Bewernitz Date: Mon, 20 Mar 2023 06:59:23 +0100 Subject: [PATCH] chore: Mark reported-levels.test.js as skipped in wallaby (#483) instead of completely excluding it. https://wallabyjs.com/docs/intro/selected-tests.html#test-file-selection --- test/error/reported-levels.test.js | 1 + wallaby.js | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/test/error/reported-levels.test.js b/test/error/reported-levels.test.js index fb8379cc3..57892aaa9 100644 --- a/test/error/reported-levels.test.js +++ b/test/error/reported-levels.test.js @@ -1,4 +1,5 @@ 'use strict'; +// wallaby:file.skip since stacktrace detection is not working in instrumented files const { LINE_TO_ERROR_INDEX, REPORTED } = require('./reported'); const { getTestParser } = require('../get-test-parser'); diff --git a/wallaby.js b/wallaby.js index 2c1880909..22e7fa77c 100644 --- a/wallaby.js +++ b/wallaby.js @@ -1,15 +1,16 @@ 'use strict'; // This is a config file to be able to run as many tests as possible using // https://wallabyjs.com/ -// usually it wrks without any config, but on of our tests doesn't, so it is excluded +// usually it works without any config, but test/error/reported-levels.test.js +// relies on stacktrace of errors which are not available in instrumented files, +// so it is marked as skipped module.exports = { - tests: { - override: (testPatterns) => { - // this test relies on stacktrace of errors which are not available in instrumented files - // they are not "visible" for wallaby, would be nicer to mark them as skipped - testPatterns.push('!test/error/reported-levels.test.js'); - return testPatterns; + hints: { + // https://wallabyjs.com/docs/intro/selected-tests.html#test-file-selection + testFileSelection: { + include: /wallaby:file\.only/, + exclude: /wallaby:file\.skip/, }, }, };