@rpcbase/test 0.367.0 → 0.369.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"clearDatabase.d.ts","sourceRoot":"","sources":["../src/clearDatabase.ts"],"names":[],"mappings":"AAGA,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAejE"}
1
+ {"version":3,"file":"clearDatabase.d.ts","sourceRoot":"","sources":["../src/clearDatabase.ts"],"names":[],"mappings":"AAGA,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBjE"}
@@ -4,7 +4,7 @@ async function clearDatabase(dbName) {
4
4
  DB_PORT,
5
5
  APP_NAME
6
6
  } = process.env;
7
- const connectionString = `mongodb://localhost:${DB_PORT}/${APP_NAME}-${dbName}`;
7
+ const connectionString = `mongodb://localhost:${DB_PORT}/${APP_NAME}-${dbName}?directConnection=true`;
8
8
  const connection = await mongoose.createConnection(connectionString).asPromise();
9
9
  await connection.dropDatabase();
10
10
  await connection.close();
@@ -1 +1 @@
1
- {"version":3,"file":"clearDatabase.js","sources":["../src/clearDatabase.ts"],"sourcesContent":["import mongoose from \"mongoose\"\n\n\nexport async function clearDatabase(dbName: string): Promise<void> {\n const { DB_PORT, APP_NAME } = process.env\n\n const connectionString = `mongodb://localhost:${DB_PORT}/${APP_NAME}-${dbName}`\n\n // console.log(\"will clear DB:\", connectionString)\n\n const connection = await mongoose\n .createConnection(connectionString)\n .asPromise()\n\n // Drop the database\n await connection.dropDatabase()\n\n await connection.close()\n}\n"],"names":["clearDatabase","dbName","DB_PORT","APP_NAME","process","env","connectionString","connection","mongoose","createConnection","asPromise","dropDatabase","close"],"mappings":";AAGA,eAAsBA,cAAcC,QAA+B;AACjE,QAAM;AAAA,IAAEC;AAAAA,IAASC;AAAAA,EAAAA,IAAaC,QAAQC;AAEtC,QAAMC,mBAAmB,uBAAuBJ,OAAO,IAAIC,QAAQ,IAAIF,MAAM;AAI7E,QAAMM,aAAa,MAAMC,SACtBC,iBAAiBH,gBAAgB,EACjCI,UAAAA;AAGH,QAAMH,WAAWI,aAAAA;AAEjB,QAAMJ,WAAWK,MAAAA;AACnB;"}
1
+ {"version":3,"file":"clearDatabase.js","sources":["../src/clearDatabase.ts"],"sourcesContent":["import mongoose from \"mongoose\"\n\n\nexport async function clearDatabase(dbName: string): Promise<void> {\n const { DB_PORT, APP_NAME } = process.env\n\n // directConnection=true skips replica-set discovery. The dev rs advertises\n // its member by the in-Docker hostname (e.g. \"mongodb:27018\"), unreachable\n // from the host, so without this the driver blocks for the full\n // serverSelectionTimeoutMS (~30s) before failing on every test DB cleanup.\n const connectionString = `mongodb://localhost:${DB_PORT}/${APP_NAME}-${dbName}?directConnection=true`\n\n // console.log(\"will clear DB:\", connectionString)\n\n const connection = await mongoose\n .createConnection(connectionString)\n .asPromise()\n\n // Drop the database\n await connection.dropDatabase()\n\n await connection.close()\n}\n"],"names":["clearDatabase","dbName","DB_PORT","APP_NAME","process","env","connectionString","connection","mongoose","createConnection","asPromise","dropDatabase","close"],"mappings":";AAGA,eAAsBA,cAAcC,QAA+B;AACjE,QAAM;AAAA,IAAEC;AAAAA,IAASC;AAAAA,EAAAA,IAAaC,QAAQC;AAMtC,QAAMC,mBAAmB,uBAAuBJ,OAAO,IAAIC,QAAQ,IAAIF,MAAM;AAI7E,QAAMM,aAAa,MAAMC,SACtBC,iBAAiBH,gBAAgB,EACjCI,UAAAA;AAGH,QAAMH,WAAWI,aAAAA;AAEjB,QAAMJ,WAAWK,MAAAA;AACnB;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/test",
3
- "version": "0.367.0",
3
+ "version": "0.369.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"