Skip to content

Commit ca0164e

Browse files
author
DylanBulmer
committed
fix tests and related bugs; update packages; fine-tune entity usage
1 parent cdd95ac commit ca0164e

11 files changed

Lines changed: 1706 additions & 519 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ jobs:
2121
node-version: "16.x"
2222
- run: yarn
2323
- run: yarn build
24-
- run: yarn test
24+
- env:
25+
MONGO_URI: ${{ secrets.MONGO_URI }}
26+
run: yarn test
2527

2628
# define job to build and publish docker image
2729
build-and-publish:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Environment variables provided by CI/CD
5151
| `GIT_REPO` | `git.repo` | Git - repository |
5252
| `NODE_ENV` | `node.env` | Node environment - `development`, `production`, `testing` |
5353
| Provided via npm | `node.verison` | Node version - example: `16.19.1` |
54-
| Provided via npm | `node.modules` | Node modules - string array of all dependencies |
54+
| Provided via yarn | `node.modules` | Node modules - string array of all dependencies |
5555
| Provided via yarn | `node.yarnVersion` | Node - package manager version |
5656

5757
## Contributing

jest.config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"^.+\\.(t|j)sx?$": "@swc/jest"
44
},
55
"testRegex": "/src/__tests__/.*\\.(test|spec)\\.(jsx?|tsx?)$",
6-
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
6+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
7+
"extensionsToTreatAsEsm": [".ts", ".tsx"],
8+
"preset": "@shelf/jest-mongodb"
79
}

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "codr-user-user",
33
"private": true,
44
"version": "1.0.3",
5+
"type": "module",
56
"scripts": {
67
"start": "node dist/serve.js",
78
"build": "swc ./src -d dist",
@@ -11,9 +12,10 @@
1112
"docker:run": "docker run --env-file=.env -p 8000:8000 ghcr.io/codrjs/codr-user-user:latest"
1213
},
1314
"devDependencies": {
15+
"@shelf/jest-mongodb": "^4.1.7",
1416
"@swc/cli": "^0.1.62",
15-
"@swc/core": "^1.3.35",
16-
"@swc/jest": "^0.2.24",
17+
"@swc/core": "^1.3.64",
18+
"@swc/jest": "^0.2.26",
1719
"@types/body-parser": "^1.19.2",
1820
"@types/cors": "^2.8.13",
1921
"@types/express": "^4.17.17",
@@ -27,21 +29,18 @@
2729
"typescript": "^4.9.3"
2830
},
2931
"dependencies": {
30-
"@casl/ability": "^6.3.3",
31-
"@casl/mongoose": "^7.1.2",
32-
"@codrjs/config": "^1.0.6",
32+
"@codrjs/config": "^1.0.7",
3333
"@codrjs/health": "^1.0.3",
3434
"@codrjs/kafka": "^1.0.2",
3535
"@codrjs/logger": "^1.0.0",
36-
"@codrjs/models": "^1.0.7",
36+
"@codrjs/models": "^1.0.13",
37+
"@codrjs/mongo": "^1.0.4",
3738
"@dylanbulmer/openapi": "^1.0.8",
3839
"body-parser": "^1.20.1",
3940
"cors": "^2.8.5",
4041
"dotenv": "^16.0.3",
4142
"express": "^4.18.2",
4243
"jsonwebtoken": "^9.0.0",
43-
"mongoose": "^7.0.1",
44-
"morgan": "^1.10.0",
45-
"winston": "^3.8.2"
44+
"morgan": "^1.10.0"
4645
}
4746
}

0 commit comments

Comments
 (0)