aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>2024-08-30 20:22:11 +0200
committerGitHub <[email protected]>2024-08-30 20:22:11 +0200
commit8f01d29f7197e7862cea7a517a88b7bfe045365d (patch)
treedb2f24b89f74e9abf28a3b75a309de32129144fe /test
parentc850653edf90e5b9ff2b507281768a8a7eadec62 (diff)
downloadfaker-8f01d29f7197e7862cea7a517a88b7bfe045365d.tar.xz
faker-8f01d29f7197e7862cea7a517a88b7bfe045365d.zip
chore(deps): update dependency typescript-eslint to v8 (#3064)
* chore(deps): update dependency typescript-eslint to v8 * chore: fix lint errors * chore: simplify code * chore: remove eslint-plugin-deprecation --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: ST-DDT <[email protected]> Co-authored-by: Shinigami92 <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/locale-imports.spec.ts2
-rw-r--r--test/simple-faker.spec.ts6
-rw-r--r--test/support/seeded-runs.ts9
-rw-r--r--test/vitest-extensions.ts1
4 files changed, 8 insertions, 10 deletions
diff --git a/test/locale-imports.spec.ts b/test/locale-imports.spec.ts
index 229f782a..b9a823b2 100644
--- a/test/locale-imports.spec.ts
+++ b/test/locale-imports.spec.ts
@@ -5,7 +5,7 @@ import { keys } from '../src/internal/keys';
describe.each(keys(allLocales))('locale imports', (locale) => {
it(`should be possible to directly require('@faker-js/faker/locale/${locale}')`, () => {
- // eslint-disable-next-line @typescript-eslint/no-var-requires, unicorn/prefer-module
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, unicorn/prefer-module
const { faker } = require(`../dist/locale/${locale}.cjs`) as {
faker: Faker;
};
diff --git a/test/simple-faker.spec.ts b/test/simple-faker.spec.ts
index 6602ed0f..aa6f00c1 100644
--- a/test/simple-faker.spec.ts
+++ b/test/simple-faker.spec.ts
@@ -9,10 +9,10 @@ describe('simpleFaker', () => {
.filter((key) => typeof console[key] === 'function')
.map((methodName) => vi.spyOn(console, methodName));
- // eslint-disable-next-line @typescript-eslint/no-var-requires, unicorn/prefer-module -- Using import() requires types being build but the CI / TS-Check runs without them.
- require('..').simpleFaker;
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, unicorn/prefer-module -- Using import() requires types being build but the CI / TS-Check runs without them.
+ expect(require('..').simpleFaker).toBeDefined();
- new SimpleFaker();
+ expect(new SimpleFaker()).toBeDefined();
for (const spy of spies) {
expect(spy).not.toHaveBeenCalled();
diff --git a/test/support/seeded-runs.ts b/test/support/seeded-runs.ts
index 62b1d616..19ef410f 100644
--- a/test/support/seeded-runs.ts
+++ b/test/support/seeded-runs.ts
@@ -165,7 +165,7 @@ class TestGenerator<
*
* @param method The name of the method.
*/
- it<TMethodName extends NoArgsMethodOf<TModule>>(method: TMethodName): this {
+ it(method: NoArgsMethodOf<TModule>): this {
return this.itRepeated(method, 1);
}
@@ -176,15 +176,12 @@ class TestGenerator<
* @param method The name of the method.
* @param repetitions The number of repetitions to run.
*/
- itRepeated<TMethodName extends NoArgsMethodOf<TModule>>(
- method: TMethodName,
- repetitions: number
- ): this {
+ itRepeated(method: NoArgsMethodOf<TModule>, repetitions: number): this {
this.expectNotTested(method);
vi_it(method, () =>
this.callAndVerify(
method,
- [] as unknown as Parameters<TModule[TMethodName]>,
+ [] as unknown as Parameters<TModule[NoArgsMethodOf<TModule>]>,
repetitions
)
);
diff --git a/test/vitest-extensions.ts b/test/vitest-extensions.ts
index 0a441d87..5e94b699 100644
--- a/test/vitest-extensions.ts
+++ b/test/vitest-extensions.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-empty-object-type */
import { expect } from 'vitest';
expect.extend({