|
2 | 2 | import { TestSuite } from '../../../../client-common/src/__tests__/TestSuite';
|
3 | 3 |
|
4 | 4 | const testSuite = new TestSuite('dictionary');
|
| 5 | +import crypto from 'crypto'; |
5 | 6 |
|
6 | 7 | describe(testSuite.testName, () => {
|
7 | 8 | const client = testSuite.makeSearchClient('ALGOLIA_APPLICATION_ID_2', 'ALGOLIA_ADMIN_KEY_2');
|
8 | 9 |
|
9 | 10 | test('stopwords', async () => {
|
10 | 11 | const stopwordEntry = {
|
11 |
| - objectID: Math.floor(Math.random() * 10000).toString(), |
| 12 | + objectID: crypto.randomBytes(16).toString('hex'), |
12 | 13 | language: 'en',
|
13 | 14 | word: 'down',
|
14 | 15 | };
|
@@ -74,7 +75,7 @@ describe(testSuite.testName, () => {
|
74 | 75 |
|
75 | 76 | test('plurals', async () => {
|
76 | 77 | const pluralEntry = {
|
77 |
| - objectID: Math.floor(Math.random() * 10000).toString(), |
| 78 | + objectID: crypto.randomBytes(16).toString('hex'), |
78 | 79 | language: 'fr',
|
79 | 80 | words: ['cheval', 'chevaux'],
|
80 | 81 | };
|
@@ -107,7 +108,7 @@ describe(testSuite.testName, () => {
|
107 | 108 |
|
108 | 109 | test('compounds', async () => {
|
109 | 110 | const compoundEntry = {
|
110 |
| - objectID: Math.floor(Math.random() * 10000).toString(), |
| 111 | + objectID: crypto.randomBytes(16).toString('hex'), |
111 | 112 | language: 'de',
|
112 | 113 | word: 'kopfschmerztablette',
|
113 | 114 | decomposition: ['kopf', 'schmerz', 'tablette'],
|
|
0 commit comments