Skip to content

Commit

Permalink
refactor: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Oct 9, 2024
1 parent c0d8804 commit 262351c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/testTreeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,6 @@ export class TestFile extends BaseTestData {
}
}

const kReplacers = new Map<string, string>([
['%i', '\\d+?'],
['%#', '\\d+?'],
['%d', '[\\d.eE+-]+?'],
['%f', '[\\d.eE+-]+?'],
['%s', '.+?'],
['%j', '.+?'],
['%o', '.+?'],
['%%', '%'],
])

class TaskName {
constructor(
private readonly data: TestData,
Expand Down Expand Up @@ -158,6 +147,17 @@ function escapeRegex(str: string) {
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
}

const kReplacers = new Map<string, string>([
['%i', '\\d+?'],
['%#', '\\d+?'],
['%d', '[\\d.eE+-]+?'],
['%f', '[\\d.eE+-]+?'],
['%s', '.+?'],
['%j', '.+?'],
['%o', '.+?'],
['%%', '%'],
])

function escapeTestName(label: string, dynamic: boolean) {
if (!dynamic) {
return escapeRegex(label)
Expand Down

0 comments on commit 262351c

Please sign in to comment.