Skip to content

Commit

Permalink
fix: add crypto to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eoaksnes committed Oct 31, 2023
1 parent e501bb5 commit 1fc0c52
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/dm-core/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ module.exports = {
...base,
testEnvironment: 'jsdom',
displayName: packageJson.name,
setupFilesAfterEnv: ['./jestSetup.js'],
}
6 changes: 6 additions & 0 deletions packages/dm-core/jestSetup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const crypto = require('crypto')

Object.defineProperty(window, 'crypto', {
value: crypto,
})
1 change: 0 additions & 1 deletion packages/dm-core/src/hooks/useList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useDMSS } from '../context/DMSSContext'
import { AxiosError, AxiosResponse, isAxiosError } from 'axios'
import { TAttribute, TLinkReference } from '../types'
import { EBlueprint } from '../Enums'
import crypto from 'crypto'

export type TItem<T> = {
key: string
Expand Down

0 comments on commit 1fc0c52

Please sign in to comment.