aboutsummaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2024-09-10 01:01:17 +0200
committerGitHub <[email protected]>2024-09-09 23:01:17 +0000
commit18ab2c7b3c8fa78c46d4abafc07c3219f41caa46 (patch)
treef6aed0914e9792ce5580b70eb50df085bcc1a212 /test/support
parentacb8b5258fa645e499831fca43b319b0439c0baf (diff)
downloadfaker-18ab2c7b3c8fa78c46d4abafc07c3219f41caa46.tar.xz
faker-18ab2c7b3c8fa78c46d4abafc07c3219f41caa46.zip
chore: improve nullish-checks in tests (#3081)
Diffstat (limited to 'test/support')
-rw-r--r--test/support/seeded-runs.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/support/seeded-runs.ts b/test/support/seeded-runs.ts
index 19ef410f..a05f1854 100644
--- a/test/support/seeded-runs.ts
+++ b/test/support/seeded-runs.ts
@@ -142,8 +142,12 @@ class TestGenerator<
repetitions: number = 1
): void {
this.setup();
+ const callable = this.module[method];
+ if (callable == null) {
+ throw new Error(`Method ${method} not found in ${this.moduleName}`);
+ }
+
for (let i = 0; i < repetitions; i++) {
- const callable = this.module[method];
const value = callable(...args);
expect(value).toMatchSnapshot();
}