Skip to content

Commit b90ac1f

Browse files
committed
ci: always set USE_LOKIJS but always use mongodb
1 parent b0c9587 commit b90ac1f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/runtime/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"build:schemas": "node scripts/buildSchemas.mjs",
2323
"cdep": "tsc && madge --circular dist",
2424
"lint:tsc": "tsc --noEmit && tsc -p test/tsconfig.json --noEmit",
25-
"test:ci:lokijs": "jest -i --coverage",
26-
"test:ci:mongodb": "jest -i --coverage",
25+
"test:ci:lokijs": "USE_LOKIJS=true jest -i --coverage",
26+
"test:ci:mongodb": "USE_LOKIJS=true jest -i --coverage",
2727
"test:local:ferretdb": "npm run test:local:start:ferretdb && CONNECTION_STRING='mongodb://root:example@localhost:27022' jest",
2828
"test:local:lokijs": "USE_LOKIJS=true jest",
2929
"test:local:mongodb": "npm run test:local:start:mongodb && CONNECTION_STRING='mongodb://root:example@localhost:27021' jest",

packages/runtime/test/lib/TestRuntime.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ export class TestRuntime extends Runtime {
7272
};
7373
}
7474

75-
protected createDatabaseConnection(): Promise<IDatabaseConnection> {
75+
protected async createDatabaseConnection(): Promise<IDatabaseConnection> {
7676
if (this.dbConnection) {
7777
throw new Error("DbConnection already created");
7878
}
7979

80-
this.dbConnection = LokiJsConnection.inMemory();
80+
this.dbConnection = new MongoDbConnection(process.env.CONNECTION_STRING!);
81+
await this.dbConnection.connect();
8182

82-
return Promise.resolve(this.dbConnection);
83+
return this.dbConnection;
8384
}
8485

8586
protected async initAccount(): Promise<void> {

0 commit comments

Comments
 (0)