aboutsummaryrefslogtreecommitdiff
path: root/test/modules
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-10-17 22:18:04 +0200
committerGitHub <[email protected]>2023-10-17 20:18:04 +0000
commit980f230947ca250086aedf37160abe86c766f969 (patch)
tree2c8e24322c2688c9ea01883bf22b4092acd27979 /test/modules
parentc0330442be99988db57e9dad12ebdcd3b3a92213 (diff)
downloadfaker-980f230947ca250086aedf37160abe86c766f969.tar.xz
faker-980f230947ca250086aedf37160abe86c766f969.zip
infra(typescript-eslint): prefer-regexp-exec (#2466)
Diffstat (limited to 'test/modules')
-rw-r--r--test/modules/airline.spec.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/modules/airline.spec.ts b/test/modules/airline.spec.ts
index 2cbb47c3..45737f5a 100644
--- a/test/modules/airline.spec.ts
+++ b/test/modules/airline.spec.ts
@@ -95,7 +95,7 @@ describe('airline', () => {
const seatRegex = /^(\d{1,2})([A-K])$/;
it('should return a random narrowbody seat when not passing an argument', () => {
const seat = faker.airline.seat();
- const matchResult = seat.match(seatRegex);
+ const matchResult = seatRegex.exec(seat);
expect(matchResult).not.toBeNull();
const row = matchResult[1];
const seatLetter = matchResult[2];
@@ -106,7 +106,7 @@ describe('airline', () => {
const seat = faker.airline.seat({
aircraftType: Aircraft.Narrowbody,
});
- const matchResult = seat.match(seatRegex);
+ const matchResult = seatRegex.exec(seat);
expect(matchResult).not.toBeNull();
const row = matchResult[1];
const seatLetter = matchResult[2];
@@ -115,7 +115,7 @@ describe('airline', () => {
});
it('should return a random regional seat', () => {
const seat = faker.airline.seat({ aircraftType: Aircraft.Regional });
- const matchResult = seat.match(seatRegex);
+ const matchResult = seatRegex.exec(seat);
expect(matchResult).not.toBeNull();
const row = matchResult[1];
const seatLetter = matchResult[2];
@@ -124,7 +124,7 @@ describe('airline', () => {
});
it('should return a random widebody seat', () => {
const seat = faker.airline.seat({ aircraftType: Aircraft.Widebody });
- const matchResult = seat.match(seatRegex);
+ const matchResult = seatRegex.exec(seat);
expect(matchResult).not.toBeNull();
const row = matchResult[1];
const seatLetter = matchResult[2];