Skip to content

Commit

Permalink
Use mock random uuid on newer node versions, as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-orlik committed Dec 11, 2023
1 parent 8b02fa7 commit 6665af5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/requestBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import { getToolRequest } from './requestBuilder'

const isInt = (num: string) => !isNaN(parseInt(num))

const mock_random_id = '2006998272.1617012296'

if (!global.crypto) {
vi.stubGlobal('crypto', {
randomUUID: () => {
return '2006998272.1617012296'
return mock_random_id
},
})
} else {
crypto.randomUUID = () => mock_random_id
}

describe('getToolRequest', () => {
Expand Down

0 comments on commit 6665af5

Please sign in to comment.