Skip to content

Commit

Permalink
fix(dictionary): generates random objectID (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Apr 13, 2021
1 parent aed6554 commit 832cad8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
import { TestSuite } from '../../../../client-common/src/__tests__/TestSuite';

const testSuite = new TestSuite('dictionary');
import crypto from 'crypto';

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

test('stopwords', async () => {
const stopwordEntry = {
objectID: Math.floor(Math.random() * 10000).toString(),
objectID: crypto.randomBytes(16).toString('hex'),
language: 'en',
word: 'down',
};
Expand Down Expand Up @@ -74,7 +75,7 @@ describe(testSuite.testName, () => {

test('plurals', async () => {
const pluralEntry = {
objectID: Math.floor(Math.random() * 10000).toString(),
objectID: crypto.randomBytes(16).toString('hex'),
language: 'fr',
words: ['cheval', 'chevaux'],
};
Expand Down Expand Up @@ -107,7 +108,7 @@ describe(testSuite.testName, () => {

test('compounds', async () => {
const compoundEntry = {
objectID: Math.floor(Math.random() * 10000).toString(),
objectID: crypto.randomBytes(16).toString('hex'),
language: 'de',
word: 'kopfschmerztablette',
decomposition: ['kopf', 'schmerz', 'tablette'],
Expand Down

0 comments on commit 832cad8

Please sign in to comment.