File tree 2 files changed +3
-5
lines changed
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 49
49
},
50
50
"dependencies" : {
51
51
"debug" : " 4.3.4" ,
52
- "mongodb-memory-server" : " 8.9.3" ,
53
- "uuid" : " 8.3.2"
52
+ "mongodb-memory-server" : " 8.9.3"
54
53
},
55
54
"devDependencies" : {
56
55
"@babel/cli" : " 7.19.3" ,
Original file line number Diff line number Diff line change @@ -4,10 +4,9 @@ import {readFileSync} from 'fs';
4
4
import type { EnvironmentContext } from '@jest/environment' ;
5
5
import type { JestEnvironmentConfig } from '@jest/environment' ;
6
6
import { MongoMemoryReplSet , MongoMemoryServer } from 'mongodb-memory-server' ;
7
+ import { randomUUID } from 'crypto' ;
7
8
import { getMongodbMemoryOptions } from './helpers' ;
8
9
9
- const uuid = require ( 'uuid' ) ;
10
-
11
10
// eslint-disable-next-line import/order
12
11
const debug = require ( 'debug' ) ( 'jest-mongodb:environment' ) ;
13
12
@@ -38,7 +37,7 @@ module.exports = class MongoEnvironment extends TestEnvironment {
38
37
this . global . __MONGO_URI__ = mongo . getUri ( ) ;
39
38
}
40
39
41
- this . global . __MONGO_DB_NAME__ = globalConfig . mongoDBName || uuid . v4 ( ) ;
40
+ this . global . __MONGO_DB_NAME__ = globalConfig . mongoDBName || randomUUID ( ) ;
42
41
43
42
await super . setup ( ) ;
44
43
}
You can’t perform that action at this time.
0 commit comments