Skip to content

Commit a0b23f8

Browse files
authored
test: add test for locale imports (#297)
1 parent 97db2b2 commit a0b23f8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/locale-imports.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { describe, expect, it } from 'vitest';
2+
import allLocales from '../src/locales';
3+
4+
describe('locale imports', () => {
5+
for (const locale in allLocales) {
6+
it(`should be possible to directly require('@faker-js/faker/locale/${locale}')`, () => {
7+
const faker = require(`../dist/cjs/locale/${locale}`);
8+
9+
expect(faker).toBeDefined();
10+
expect(faker.locale).toBe(locale);
11+
});
12+
}
13+
});

0 commit comments

Comments
 (0)