diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-10-03 18:04:19 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-10-03 18:04:19 +0200 |
| commit | 3352727aa638fcfcc6461d2aaded8ef9603acc0d (patch) | |
| tree | 880b381af0c1e717803c6fa233cc8792193d84dd /apps/kit/src/lib/configuration.ts | |
| parent | c5af87a9312affc84ee9dbc654f8a4942f0d1e1c (diff) | |
| download | greatoffice-3352727aa638fcfcc6461d2aaded8ef9603acc0d.tar.xz greatoffice-3352727aa638fcfcc6461d2aaded8ef9603acc0d.zip | |
feat: Initial setup facilitating testing
Diffstat (limited to 'apps/kit/src/lib/configuration.ts')
| -rw-r--r-- | apps/kit/src/lib/configuration.ts | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/kit/src/lib/configuration.ts b/apps/kit/src/lib/configuration.ts index fa828ca..5a6a1bf 100644 --- a/apps/kit/src/lib/configuration.ts +++ b/apps/kit/src/lib/configuration.ts @@ -9,10 +9,13 @@ export function api_base(path: string = ""): string { } export function is_development(): boolean { - // @ts-ignore return import.meta.env.DEV; } +export function is_testing(): boolean { + return import.meta.env.VITE_TESTING; +} + export function is_debug(): boolean { return localStorage.getItem(StorageKeys.debug) !== "true"; } @@ -23,6 +26,22 @@ export const CookieNames = { session: "go_session" }; +export function get_test_context(): TestContext { + return { + user: { + username: import.meta.env.VITE_TEST_USERNAME, + password: import.meta.env.VITE_TEST_PASSWORD + } + } +} + +export interface TestContext { + user: { + username: string, + password: string + } +} + export const QueryKeys = { labels: "labels", categories: "categories", |
