mirror of
https://github.com/netlight/my-finance-pal-backend.git
synced 2024-11-10 00:51:56 +01:00
Only run unit tests on CI
This commit is contained in:
parent
badaed630b
commit
384bc051a1
7 changed files with 55 additions and 30 deletions
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
|
@ -25,8 +25,8 @@ jobs:
|
|||
- name: Build application
|
||||
run: yarn build
|
||||
|
||||
- name: Run tests
|
||||
run: yarn test
|
||||
- name: Run unit tests
|
||||
run: yarn test:unit
|
||||
|
||||
cloud_build:
|
||||
needs: build_and_test
|
||||
|
|
9
jest.config.integration.ts
Normal file
9
jest.config.integration.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import baseConfig from "./jest.config"
|
||||
import { type Config } from "jest";
|
||||
|
||||
const config: Config = {
|
||||
...baseConfig,
|
||||
testRegex: ".*\\.integration\\.spec\\.ts$",
|
||||
}
|
||||
|
||||
export default config;
|
24
jest.config.ts
Normal file
24
jest.config.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { type Config } from "jest";
|
||||
|
||||
const config: Config = {
|
||||
moduleFileExtensions: [
|
||||
"js",
|
||||
"json",
|
||||
"ts"
|
||||
],
|
||||
rootDir: ".",
|
||||
transform: {
|
||||
"^.+\\.(t|j)s$": "ts-jest"
|
||||
},
|
||||
testEnvironment: "node",
|
||||
roots: [
|
||||
"<rootDir>/src/"
|
||||
],
|
||||
moduleDirectories: [
|
||||
"node_modules",
|
||||
"src"
|
||||
],
|
||||
setupFiles: ["./src/preStart.ts"]
|
||||
}
|
||||
|
||||
export default config;
|
9
jest.config.unit.ts
Normal file
9
jest.config.unit.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import baseConfig from "./jest.config"
|
||||
import { type Config } from "jest";
|
||||
|
||||
const config: Config = {
|
||||
...baseConfig,
|
||||
testRegex: ".*\\.unit\\.spec\\.ts$",
|
||||
}
|
||||
|
||||
export default config;
|
24
package.json
24
package.json
|
@ -13,7 +13,8 @@
|
|||
"build": "run-s clean generate-api-types compile copy-resources",
|
||||
"lint": "eslint --ext .ts src/",
|
||||
"dev": "nodemon src/server.ts",
|
||||
"test": "jest"
|
||||
"test:unit": "jest --config \"jest.config.unit.ts\"",
|
||||
"test:integration": "jest --config \"jest.config.integration.ts\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/supertest": "^2.0.12",
|
||||
|
@ -60,26 +61,5 @@
|
|||
"ts-node": "^10.9.1",
|
||||
"tsconfig-paths": "^4.1.2",
|
||||
"typescript": "^5.0.3"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
"js",
|
||||
"json",
|
||||
"ts"
|
||||
],
|
||||
"rootDir": ".",
|
||||
"testRegex": ".*\\.spec\\.ts$",
|
||||
"transform": {
|
||||
"^.+\\.(t|j)s$": "ts-jest"
|
||||
},
|
||||
"testEnvironment": "node",
|
||||
"roots": [
|
||||
"<rootDir>/src/"
|
||||
],
|
||||
"moduleDirectories": [
|
||||
"node_modules",
|
||||
"src"
|
||||
],
|
||||
"setupFiles": ["./src/preStart.ts"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,13 +19,16 @@ interface Args {
|
|||
// **** Setup **** //
|
||||
|
||||
// Command line arguments
|
||||
const args = parse<Args>({
|
||||
const args = parse<Args>(
|
||||
{
|
||||
env: {
|
||||
type: String,
|
||||
defaultValue: process.env.NODE_ENV ?? "development",
|
||||
alias: "e",
|
||||
},
|
||||
});
|
||||
},
|
||||
{ partial: true }
|
||||
);
|
||||
|
||||
// Set the env file
|
||||
const dotenvConfig = dotenv.config({
|
||||
|
|
Loading…
Reference in a new issue