Skip to content

Commit 13186d2

Browse files
committed
fix(newman): fixed newman test failing due to tsc build config
1 parent bf2d6e2 commit 13186d2

File tree

12 files changed

+29
-16
lines changed

12 files changed

+29
-16
lines changed

.dockerignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Dockerfile
22
docker-compose.yml
33
*.ts
44
**/*.ts
5-
src
5+
**/*.test.js
66
.husky
77
.gitignore
88
dev-server.js
@@ -11,4 +11,6 @@ service-collection.postman_collection.json
1111
tsconfig.json
1212
tslint.json
1313
logs
14-
cocverage
14+
coverage
15+
node_modules
16+
publish.sh

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ jobs:
2020
run: |
2121
npm ci
2222
npm run build
23-
- name: Test
24-
run: npm run test
25-
- name: Newman Tests
26-
run: npm run test:newman
23+
npm run test
24+
npm run test:newman
2725
Publish:
2826
runs-on: ubuntu-latest
2927
if: ${{ github.ref == 'refs/heads/main' }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,5 @@ dist
125125
### Node Patch ###
126126
# Serverless Webpack directories
127127
.webpack/
128-
app
128+
app/**/*.js
129+
app/**/*.d.ts

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM public.ecr.aws/lambda/nodejs:14
22

33
COPY . ${LAMBDA_TASK_ROOT}
44

5-
RUN npm ci
5+
RUN npm ci --only=production
66

77
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
88
CMD [ "app/index.handler" ]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ services:
33
app.handler:
44
ports:
55
- '9000:8080'
6-
build: .
7-
volumes:
8-
- .://var/task/
6+
build: .

jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,15 @@
22
module.exports = {
33
preset: 'ts-jest',
44
testEnvironment: 'node',
5+
testMatch: [
6+
"**/__tests__/**/*.ts?(x)",
7+
"**/?(*.)+(spec|test).ts?(x)"
8+
],
9+
collectCoverage: true,
10+
// collectCoverageFrom: [
11+
// "./app/**/*.ts",
12+
// "!./app/**/*.js",
13+
// "!./app/**/*.d.ts",
14+
// "!./app/**/*.(spec|test).ts"
15+
// ]
516
};

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
"scripts": {
2525
"start": "tsc --watch --preserveWatchOutput & nodemon dev-server.js -e js -w ./app",
2626
"build": "tsc",
27-
"test": "jest --coverage",
28-
"test:watch": "jest --watch --coverage",
27+
"test": "jest",
28+
"test:watch": "jest --watch",
2929
"test:newman": "node dev-server.js --test",
3030
"lint": "tslint --fix -p ./tsconfig.json",
31-
"prettier": "prettier --write './src/**/*.ts?(x)'",
31+
"prettier": "prettier --write './**/*.ts?(x)'",
3232
"release": "semantic-release"
3333
},
3434
"husky": {

tsconfig.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
1212
// "sourceMap": true, /* Generates corresponding '.map' file. */
1313
// "outFile": "./", /* Concatenate and emit output to single file. */
14-
"outDir": "app", /* Redirect output structure to the directory. */
14+
// "outDir": "app", /* Redirect output structure to the directory. */
1515
// "rootDir": "src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
1616
// "composite": true, /* Enable project compilation */
1717
// "removeComments": true, /* Do not emit comments to output. */
@@ -37,7 +37,10 @@
3737
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
3838
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
3939
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
40-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
40+
"rootDirs": [
41+
"src",
42+
"package.json"
43+
], /* List of root folders whose combined content represents the structure of the project at runtime. */
4144
// "typeRoots": [], /* List of folders to include type definitions from. */
4245
"types": [
4346
"node",

0 commit comments

Comments
 (0)