aboutsummaryrefslogtreecommitdiff
path: root/test/modules/helpers.spec.ts
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2024-02-27 20:57:27 +0100
committerGitHub <[email protected]>2024-02-27 19:57:27 +0000
commit4ab073164beab2bf690d7fffc7773e7b76d8e07e (patch)
tree1549dc0aba1646f27edcc00f1651f74a0b5b21fb /test/modules/helpers.spec.ts
parent0d4cba637cdd38e7757ecca1b7eae75d7a737fa8 (diff)
downloadfaker-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.ts17
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']);
+ });
+ });
});