Skip to content

Commit 832cad8

Browse files
authored
fix(dictionary): generates random objectID (#1265)
1 parent aed6554 commit 832cad8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/client-search/src/__tests__/integration/dictionary.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
import { TestSuite } from '../../../../client-common/src/__tests__/TestSuite';
33

44
const testSuite = new TestSuite('dictionary');
5+
import crypto from 'crypto';
56

67
describe(testSuite.testName, () => {
78
const client = testSuite.makeSearchClient('ALGOLIA_APPLICATION_ID_2', 'ALGOLIA_ADMIN_KEY_2');
89

910
test('stopwords', async () => {
1011
const stopwordEntry = {
11-
objectID: Math.floor(Math.random() * 10000).toString(),
12+
objectID: crypto.randomBytes(16).toString('hex'),
1213
language: 'en',
1314
word: 'down',
1415
};
@@ -74,7 +75,7 @@ describe(testSuite.testName, () => {
7475

7576
test('plurals', async () => {
7677
const pluralEntry = {
77-
objectID: Math.floor(Math.random() * 10000).toString(),
78+
objectID: crypto.randomBytes(16).toString('hex'),
7879
language: 'fr',
7980
words: ['cheval', 'chevaux'],
8081
};
@@ -107,7 +108,7 @@ describe(testSuite.testName, () => {
107108

108109
test('compounds', async () => {
109110
const compoundEntry = {
110-
objectID: Math.floor(Math.random() * 10000).toString(),
111+
objectID: crypto.randomBytes(16).toString('hex'),
111112
language: 'de',
112113
word: 'kopfschmerztablette',
113114
decomposition: ['kopf', 'schmerz', 'tablette'],

0 commit comments

Comments
 (0)