Skip to content

Commit

Permalink
[api][SIMS-#270] Update all tests to get local env
Browse files Browse the repository at this point in the history
  • Loading branch information
fwpushan committed Mar 26, 2021
1 parent 79b4369 commit 1291ef8
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sources/packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test:e2e": "ENVIRONMENT=test jest --config ./test/jest-e2e.json",
"setup:db": "ts-node scripts/setupDB",
"local": "ENVIRONMENT=local NODE_ENV=local npm run start:dev",
"test:local": "NODE_ENV=local jest",
"test:local": "NODE_ENV=local ENVIRONMENT=test jest",
"setup:archive:db": "ts-node scripts/setupArchiveDB",
"docker:start": "npm run setup:db && npm run setup:archive:db && node dist/main"
},
Expand Down
1 change: 1 addition & 0 deletions sources/packages/api/src/app.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("../env_setup");
import { Test, TestingModule } from "@nestjs/testing";
import { getConnection } from "typeorm";
import { AppController } from "./app.controller";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("../../../env_setup");
import { Test, TestingModule } from "@nestjs/testing";
import { ConfigService } from "../../services/config/config.service";
import { ConfigController } from "./config.controller";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("../../../env_setup");
import { Test, TestingModule } from "@nestjs/testing";
import {
BCeIDService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("../../../env_setup");
import { Test, TestingModule } from "@nestjs/testing";
import { ArchiveDbService, StudentService, UserService } from "../../services";
import { StudentController } from "./student.controller";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("../../../env_setup");
import { Test, TestingModule } from "@nestjs/testing";
import { DatabaseService } from "../../database/database.service";
import { DatabaseModule } from "../../database/database.module";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("../../../env_setup");
import { Test, TestingModule } from "@nestjs/testing";
import { ConfigService } from "../config/config.service";
import { FormService } from "./form.service";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("../../../env_setup");
import { Test, TestingModule } from "@nestjs/testing";
import { ConfigService } from "../config/config.service";
import { ServiceAccountService } from "../service-account/service-account.service";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("../../../env_setup");
import { Test, TestingModule } from "@nestjs/testing";
import { ConfigService } from "../config/config.service";
import { ServiceAccountService } from "./service-account.service";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("../../../env_setup");
import { Test, TestingModule } from "@nestjs/testing";
import { DatabaseService } from "../../database/database.service";
import { DatabaseModule } from "../../database/database.module";
Expand Down
2 changes: 1 addition & 1 deletion sources/packages/api/src/testHelpers/testDBSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export async function setupDB() {
try {
const connection = await createConnection({
...config,
logging: ["error", "warn", "info"],
logging: ["error", "warn"],
});
return connection;
} catch (excp) {
Expand Down

0 comments on commit 1291ef8

Please sign in to comment.