diff options
| author | ST-DDT <[email protected]> | 2024-02-27 20:57:27 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-27 19:57:27 +0000 |
| commit | 4ab073164beab2bf690d7fffc7773e7b76d8e07e (patch) | |
| tree | 1549dc0aba1646f27edcc00f1651f74a0b5b21fb /test/modules/helpers.spec.ts | |
| parent | 0d4cba637cdd38e7757ecca1b7eae75d7a737fa8 (diff) | |
| download | faker-4ab073164beab2bf690d7fffc7773e7b76d8e07e.tar.xz faker-4ab073164beab2bf690d7fffc7773e7b76d8e07e.zip | |
feat!: high precision random number generator (#2357)
Diffstat (limited to 'test/modules/helpers.spec.ts')
| -rw-r--r-- | test/modules/helpers.spec.ts | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/modules/helpers.spec.ts b/test/modules/helpers.spec.ts index c389fa8e..1ba43c70 100644 --- a/test/modules/helpers.spec.ts +++ b/test/modules/helpers.spec.ts @@ -798,14 +798,6 @@ describe('helpers', () => { expect(unique).not.toContainDuplicates(); expect(unique).toHaveLength(2); }); - - it('works as expected when seeded', () => { - const input = ['a', 'a', 'a', 'a', 'a', 'f', 'g', 'h', 'i', 'j']; - const length = 5; - faker.seed(100); - const unique = faker.helpers.uniqueArray(input, length); - expect(unique).toStrictEqual(['g', 'a', 'i', 'f', 'j']); - }); }); describe('mustache()', () => { @@ -1179,4 +1171,13 @@ describe('helpers', () => { }); } ); + + describe('uniqueArray', () => { + it('works as expected when seeded', () => { + const input = ['a', 'a', 'a', 'a', 'a', 'f', 'g', 'h', 'i', 'j']; + faker.seed(100); + const unique = faker.helpers.uniqueArray(input, 5); + expect(unique).toStrictEqual(['j', 'a', 'g', 'i', 'f']); + }); + }); }); |
