Skip to content

Commit

Permalink
🧪 test(bootstrap): remove needless bootstrap setups
Browse files Browse the repository at this point in the history
  • Loading branch information
thrownullexception committed Mar 11, 2024
1 parent 8f22bda commit 97c1d9a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
2 changes: 0 additions & 2 deletions src/__tests__/_/forCodeCoverage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FOR_CODE_COV as $1 } from "backend/lib/request/validations/types";
import { FOR_CODE_COV as $2 } from "backend/types";
import { FOR_CODE_COV as $3 } from "shared/form-schemas/types";
import { FOR_CODE_COV as $4 } from "shared/validations/types";
import { FOR_CODE_COV as $5 } from "shared/types/options";
Expand Down Expand Up @@ -46,7 +45,6 @@ import { noop } from "shared/lib/noop";

noop(
$1,
$2,
$3,
$4,
$5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ const PERSITENT_ADAPTORS: {
describe.each(PERSITENT_ADAPTORS)(
"$title persistence adaptor",
({ adaptor, title }) => {
beforeAll(async () => {
await adaptor.setup();
});

it("should get create new item when persisting", async () => {
await adaptor.persistItem("foo", { age: 5, id: "foo", name: "Hello" });
});
Expand Down
15 changes: 8 additions & 7 deletions src/backend/lib/config/config.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,17 @@ describe("Config Service", () => {
it("should throw error on prod for empty env", async () => {
ConfigApiService.isInitialized = false;

expect(() =>
new ConfigApiService({
ENV_LOCAL_FILE,
NODE_ENV: "production",
}).bootstrap()
expect(
() =>
new ConfigApiService({
ENV_LOCAL_FILE,
NODE_ENV: "production",
})
).toThrowError();
});

it("should create new valid config file when empty", async () => {
new ConfigApiService({ ENV_LOCAL_FILE }).bootstrap();
new ConfigApiService({ ENV_LOCAL_FILE });

const content = fs.readFileSync(fullPath).toString();

Expand Down Expand Up @@ -145,7 +146,7 @@ describe("Config Service", () => {
new ConfigApiService({
...oldEnv,
ENV_LOCAL_FILE,
}).bootstrap();
});

const content = fs.readFileSync(fullPath).toString();

Expand Down
4 changes: 0 additions & 4 deletions src/backend/lib/key-value/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ export class KeyValueStoreApiService<T> {
private readonly _keyValueStorePersistenceService: AbstractConfigDataPersistenceService<IStorage>
) {}

async bootstrap() {
await this._keyValueStorePersistenceService.setup();
}

async clearItem() {
await this._keyValueStorePersistenceService.removeItem(this.key);
}
Expand Down

0 comments on commit 97c1d9a

Please sign in to comment.