Skip to content

Commit eb79789

Browse files
committed
Add sample environment configuration and enhance tests with connection validation
Signed-off-by: worksofliam <[email protected]>
1 parent 61a5413 commit eb79789

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/api/.env.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
VITE_SERVER=
2+
VITE_DB_USER=
3+
VITE_DB_PASS=
4+
VITE_DB_PORT=22

src/api/tests/a.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// sum.test.js
22
import { expect, test } from 'vitest'
3+
import { getConnection } from './state'
4+
import exp from 'constants';
35

46
test('adds 1 + 2 to equal 3', () => {
5-
expect(1+2).toBe(3)
7+
const conn = getConnection();
8+
expect(conn).toBeDefined();
9+
expect(1+2).toBe(3);
610
})

src/api/tests/globalSetup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import IBMi from "../IBMi";
33
import { ENV_CREDS } from "./env";
44
import { getConnection, setConnection } from "./state";
55
import { afterAll, beforeAll, expect } from "vitest";
6-
import { CodeForIStorage, ConnectionStorage, VirtualStorage } from "../configuration/storage/CodeForIStorage";
6+
import { CodeForIStorage } from "../configuration/storage/CodeForIStorage";
77
import { VirtualConfig } from "../configuration/config/VirtualConfig";
8+
import { VirtualStorage } from "../configuration/storage/BaseStorage";
89

910
beforeAll(async () => {
1011
const virtualStorage = new VirtualStorage();

0 commit comments

Comments
 (0)