Skip to content

Commit d1a64bf

Browse files
author
Julia Volkova
committed
unique part of path instead of basename
1 parent c31db32 commit d1a64bf

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

e2e/testcafe-devextreme/runner.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import createTestCafe, { ClientFunction } from 'testcafe';
22
import * as fs from 'fs';
3-
import * as path from 'path';
43
import * as process from 'process';
54
import parseArgs from 'minimist';
65
import { globSync } from 'glob';
@@ -150,6 +149,7 @@ createTestCafe(TESTCAFE_CONFIG)
150149
const reporter = typeof args.reporter === 'string' ? args.reporter.trim() : args.reporter;
151150
const indices = args.indices.trim();
152151
let componentFolder = args.componentFolder.trim();
152+
const pathRE = new RegExp(`./tests/${componentFolder ? `${componentFolder}/` : ''}(.*).ts`);
153153
const file = args.file.trim();
154154

155155
setTestingPlatform(args);
@@ -198,14 +198,14 @@ createTestCafe(TESTCAFE_CONFIG)
198198
/* eslint-enable no-console */
199199

200200
const targetBaseNames = new Set(
201-
targetFixtureChunk.map((filePath) => path.basename(filePath)),
201+
targetFixtureChunk.map((filePath) => pathRE.exec(filePath)?.[1]),
202202
);
203203

204204
filters.push((
205205
_testName: string,
206206
_fixtureName: string,
207207
fixturePath: string,
208-
) => targetBaseNames.has(path.basename(fixturePath)));
208+
) => targetBaseNames.has(pathRE.exec(fixturePath)?.[1]));
209209
}
210210

211211
if (testName) {
@@ -274,6 +274,7 @@ createTestCafe(TESTCAFE_CONFIG)
274274
process.exit(failedCount);
275275
})
276276
.catch((error: Error) => {
277+
// eslint-disable-next-line no-console
277278
console.error('TestCafe execution failed:', error);
278279
if (testCafe) {
279280
testCafe.close();

0 commit comments

Comments
 (0)