refine test file exclusion logic by expanding ignore patterns and updating regex handling

This commit is contained in:
Nacho Codoñer
2026-02-17 18:43:38 +01:00
parent 4391d4959a
commit a1eb3c237a
11 changed files with 36 additions and 6 deletions

View File

@@ -117,7 +117,7 @@ function createIgnoreRegex(globPatterns) {
// For absolute paths, we don't want to force the pattern to match from the beginning
// but we still want to ensure it matches to the end of the path segment
regexPattern = '(?:^|/)' + regexPattern + (pattern.endsWith('*') ? '' : '$');
regexPattern = '(?:^|/)' + regexPattern;
return regexPattern;
}).filter(pattern => pattern !== null);

View File

@@ -1,12 +1,12 @@
{
"name": "@meteorjs/rspack",
"version": "1.1.0-beta.5",
"version": "1.1.0-beta.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@meteorjs/rspack",
"version": "1.1.0-beta.5",
"version": "1.1.0-beta.6",
"license": "ISC",
"dependencies": {
"fast-deep-equal": "^3.1.3",

View File

@@ -1,6 +1,6 @@
{
"name": "@meteorjs/rspack",
"version": "1.1.0-beta.5",
"version": "1.1.0-beta.6",
"description": "Configuration logic for using Rspack in Meteor projects",
"main": "index.js",
"type": "commonjs",

View File

@@ -5,7 +5,7 @@
export const DEFAULT_RSPACK_VERSION = '1.7.1';
export const DEFAULT_METEOR_RSPACK_VERSION = '1.1.0-beta.5';
export const DEFAULT_METEOR_RSPACK_VERSION = '1.1.0-beta.6';
export const DEFAULT_METEOR_RSPACK_REACT_HMR_VERSION = '1.4.3';

View File

@@ -1 +1,6 @@
react-router*
folder-to-ignore/
file-to-ignore.app-test.js
**/glob-ignore/*.app-test.js
prefix-*
*-suffix

View File

@@ -0,0 +1,5 @@
describe("file-to-ignore.app-test.js pattern", () => {
it("should not run as ignored", () => {
throw new Error("test should be ignored by eager test loading");
});
});

View File

@@ -0,0 +1,5 @@
describe("folder-to-ignore/ pattern", () => {
it("should not run as ignored", () => {
throw new Error("test should be ignored by eager test loading");
});
});

View File

@@ -0,0 +1,5 @@
describe("prefix-* pattern", () => {
it("should not run as ignored", () => {
throw new Error("test should be ignored by eager test loading");
});
});

View File

@@ -1,4 +1,4 @@
describe("Ignore", () => {
describe("react-router* pattern", () => {
it("should not run as ignored", () => {
throw new Error("test should be ignored by eager test loading");
});

View File

@@ -0,0 +1,5 @@
describe("*-suffix pattern", () => {
it("should not run as ignored", () => {
throw new Error("test should be ignored by eager test loading");
});
});

View File

@@ -0,0 +1,5 @@
describe("**/glob-ignore/*.app-test.js pattern", () => {
it("should not run as ignored", () => {
throw new Error("test should be ignored by eager test loading");
});
});