diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/faker.spec.ts | 5 | ||||
| -rw-r--r-- | test/locale-imports.spec.ts | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/test/faker.spec.ts b/test/faker.spec.ts index a026577b..63ae794e 100644 --- a/test/faker.spec.ts +++ b/test/faker.spec.ts @@ -13,15 +13,14 @@ describe('faker', () => { ); }); - it('should not log anything on startup', () => { + it('should not log anything on startup', async () => { const spies: MockInstance[] = keys(console) .filter((key) => typeof console[key] === 'function') .map((methodName) => vi.spyOn(console, methodName as keyof typeof console) ); - // 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('..').faker; + (await import('..')).default; new Faker({ locale: { metadata: { title: '' } } }); diff --git a/test/locale-imports.spec.ts b/test/locale-imports.spec.ts index 5f07056b..4c1197c8 100644 --- a/test/locale-imports.spec.ts +++ b/test/locale-imports.spec.ts @@ -6,7 +6,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 - const { faker } = require(`../dist/locale/${locale}`) as { + const { faker } = require(`../dist/locale/${locale}.cjs`) as { faker: Faker; }; |
