From 785aa5ee392cdbcbd18fa6c6c379f671a1884d11 Mon Sep 17 00:00:00 2001 From: Paulius Michelevicius Date: Thu, 21 Nov 2024 14:42:16 +0000 Subject: [PATCH] SQNC-46: updated package.json script for integration test to utilize SWC --- .swcrc | 4 ++-- package.json | 2 +- src/env.ts | 4 ++++ test/mocharc.json | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.swcrc b/.swcrc index ba2ceaa..47bafbf 100644 --- a/.swcrc +++ b/.swcrc @@ -6,13 +6,13 @@ "syntax": "typescript", "tsx": false, "decorators": true, - "dynamicImport": true, + "dynamicImport": true }, "transform": { "legacyDecorator": true, "useDefineForClassFields": true }, - "target": "es2022", + "target": "es2022" }, "exclude": [ "/__test__/" diff --git a/package.json b/package.json index 4f1890d..9ceb3db 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "main": "src/index.ts", "scripts": { "build": "npm run tsoa:build && swc ./src -d ./build --strip-leading-paths --copy-files", - "test": "NODE_ENV=test ./node_modules/.bin/mocha --config ./test/mocharc.json ./test/**/*.test.ts", + "test": "SWCRC=true NODE_ENV=dev node --trace-warnings --enable-source-maps ./node_modules/.bin/mocha --config ./test/mocharc.json ./test/**/*.test.ts", "lint": "prettier -c ./src ./test ./migrations", "lint:fix": "npm run lint -- -w", "depcheck": "depcheck", diff --git a/src/env.ts b/src/env.ts index edfd133..bca19fa 100644 --- a/src/env.ts +++ b/src/env.ts @@ -36,6 +36,10 @@ const envConfig = { IDP_JWKS_PATH: envalid.str({ default: '/certs', }), + + IDP_AUTH_PATH: envalid.str({ + default: '/auth', + }), } export type ENV_CONFIG = typeof envConfig diff --git a/test/mocharc.json b/test/mocharc.json index 129908f..f89423c 100644 --- a/test/mocharc.json +++ b/test/mocharc.json @@ -1,7 +1,8 @@ { "timeout": 5000, "exit": true, - "extension": "js", + "esm": true, + "extension": "ts", "file": ["test/init.ts"], "node-option": ["import=@swc-node/register/esm-register"] }