0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

test(toolkit): setup global crypto for tests

This commit is contained in:
Gao Sun 2023-08-31 00:04:19 +08:00
parent b685c9cb4e
commit ed7d842517
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
3 changed files with 5 additions and 2 deletions

View file

@ -5,6 +5,7 @@ const config = {
coverageReporters: ['text-summary', 'lcov'],
coverageProvider: 'v8',
roots: ['./lib'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleNameMapper: {
'^(chalk|inquirer)$': '<rootDir>/../../shared/lib/esm/module-proxy.js',
},

View file

@ -0,0 +1,4 @@
import crypto from 'node:crypto';
// eslint-disable-next-line @silverhand/fp/no-mutation
global.crypto = crypto;

View file

@ -1,5 +1,3 @@
import crypto from 'node:crypto';
import { z } from 'zod';
/** A word that used for password policy. */