aboutsummaryrefslogtreecommitdiff
path: root/test/modules/helpers.spec.ts
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-10-07 11:05:58 +0200
committerGitHub <[email protected]>2023-10-07 09:05:58 +0000
commiteb2b18b8a0e64eded3731bae4204d2925dbef3e7 (patch)
tree0ace6e551d0a75fae07e6acef448b48691589cdc /test/modules/helpers.spec.ts
parentc80c035333e3c832c46dc7dcac5c86a289829e0d (diff)
downloadfaker-eb2b18b8a0e64eded3731bae4204d2925dbef3e7.tar.xz
faker-eb2b18b8a0e64eded3731bae4204d2925dbef3e7.zip
infra(eslint): enable no-useless-escape eslint rule (#2434)
Diffstat (limited to 'test/modules/helpers.spec.ts')
-rw-r--r--test/modules/helpers.spec.ts22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/modules/helpers.spec.ts b/test/modules/helpers.spec.ts
index df8f00e7..47131376 100644
--- a/test/modules/helpers.spec.ts
+++ b/test/modules/helpers.spec.ts
@@ -563,7 +563,7 @@ describe('helpers', () => {
'6453-####-####-####-###L'
);
expect(number).toMatch(
- /^6453\-([0-9]){4}\-([0-9]){4}\-([0-9]){4}\-([0-9]){4}$/
+ /^6453-([0-9]){4}-([0-9]){4}-([0-9]){4}-([0-9]){4}$/
);
expect(number).toSatisfy(luhnCheck);
});
@@ -574,7 +574,7 @@ describe('helpers', () => {
'*'
);
expect(number).toMatch(
- /^6453\-([0-9]){4}\-([0-9]){4}\-([0-9]){4}\-([0-9]){4}$/
+ /^6453-([0-9]){4}-([0-9]){4}-([0-9]){4}-([0-9]){4}$/
);
expect(number).toSatisfy(luhnCheck);
});
@@ -585,14 +585,14 @@ describe('helpers', () => {
'*'
);
expect(number).toMatch(
- /^6453\-([0-9]){4}\-([0-9]){4}\-([0-9]){4}\-([0-9]){4}$/
+ /^6453-([0-9]){4}-([0-9]){4}-([0-9]){4}-([0-9]){4}$/
);
expect(number).toSatisfy(luhnCheck);
number = faker.helpers.replaceCreditCardSymbols(
'645[5-9]-#{4,6}-#{1,2}-#{4,6}-#{3}L'
);
expect(number).toMatch(
- /^645[5-9]\-([0-9]){4,6}\-([0-9]){1,2}\-([0-9]){4,6}\-([0-9]){4}$/
+ /^645[5-9]-([0-9]){4,6}-([0-9]){1,2}-([0-9]){4,6}-([0-9]){4}$/
);
expect(number).toSatisfy(luhnCheck);
});
@@ -607,14 +607,14 @@ describe('helpers', () => {
const string = faker.helpers.regexpStyleStringParse('#{5,10}');
expect(string.length).toBeLessThanOrEqual(10);
expect(string.length).toBeGreaterThanOrEqual(5);
- expect(string).toMatch(/^\#{5,10}$/);
+ expect(string).toMatch(/^#{5,10}$/);
});
it('flips the range when min > max', () => {
const string = faker.helpers.regexpStyleStringParse('#{10,5}');
expect(string.length).toBeLessThanOrEqual(10);
expect(string.length).toBeGreaterThanOrEqual(5);
- expect(string).toMatch(/^\#{5,10}$/);
+ expect(string).toMatch(/^#{5,10}$/);
});
it('repeats string {n} number of times', () => {
@@ -638,9 +638,7 @@ describe('helpers', () => {
const string = faker.helpers.regexpStyleStringParse(
'Test#{5}%{2,5}Testing**[1-5]**{10}END'
);
- expect(string).toMatch(
- /^Test\#{5}%{2,5}Testing\*\*[1-5]\*\*{10}END$/
- );
+ expect(string).toMatch(/^Test#{5}%{2,5}Testing\*\*[1-5]\*\*{10}END$/);
});
});
@@ -649,7 +647,7 @@ describe('helpers', () => {
const string = faker.helpers.fromRegExp(/#{5,10}/);
expect(string.length).toBeLessThanOrEqual(10);
expect(string.length).toBeGreaterThanOrEqual(5);
- expect(string).toMatch(/^\#{5,10}$/);
+ expect(string).toMatch(/^#{5,10}$/);
});
it('repeats string {n} number of times', () => {
@@ -667,7 +665,7 @@ describe('helpers', () => {
const string = faker.helpers.fromRegExp(
'Test#{5}%{2,5}Testing*[1-5]{10}END'
);
- expect(string).toMatch(/^Test\#{5}%{2,5}Testing*[1-5]{10}END$/);
+ expect(string).toMatch(/^Test#{5}%{2,5}Testing*[1-5]{10}END$/);
});
it('throws error when min > max outside set', () => {
@@ -1176,7 +1174,7 @@ describe('helpers', () => {
'lName',
'domain',
]); // third argument is provider, or domain for email
- expect(result).toMatch(/\@domain/);
+ expect(result).toMatch(/@domain/);
});
it('should be possible to limit unique call by maxTime in ms', () => {