File tree 9 files changed +38
-53
lines changed
9 files changed +38
-53
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,10 @@ jobs:
37
37
- name : Build application
38
38
run : npm run build
39
39
40
- - name : Run unit tests
41
- run : npm run test:unit:cov
42
-
43
- - name : Run e2e tests
40
+ - name : Run tests
44
41
run : |
45
42
docker-compose -f docker-compose.test.yaml up -d
46
- npm run test:e2e
43
+ npm run test:cov
47
44
48
45
- name : SonarCloud Scan
49
46
uses : sonarsource/sonarcloud-github-action@master
Original file line number Diff line number Diff line change 1
1
.idea /*
2
- .vscode /*
3
- .unit-test /*
2
+ .coverage /*
4
3
node_modules /*
5
4
dist /*
6
5
test-report.xml
Original file line number Diff line number Diff line change
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version" : " 0.2.0" ,
6
+ "configurations" : [
7
+ {
8
+ "type" : " node" ,
9
+ "request" : " launch" ,
10
+ "name" : " RUN" ,
11
+ "program" : " ${workspaceFolder}/dist/Main.js" ,
12
+ "sourceMaps" : true ,
13
+ "args" : [" dotenv_config_path=/${workspaceFolder}/dist/.env" ],
14
+ "skipFiles" : [" <node_internals>/**" ],
15
+ "runtimeArgs" : [" -r" , " dotenv/config" ],
16
+ "preLaunchTask" : " npm: copy:local-env" ,
17
+ "outputCapture" : " std"
18
+ }
19
+ ]
20
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "editor.lightbulb.enabled" : false ,
3
+ "jestrunner.configPath" : " jest.json"
4
+ }
Original file line number Diff line number Diff line change @@ -89,21 +89,11 @@ IPoster is a simple fictional application that allows users to publish posts.
89
89
90
90
* ** Testing**
91
91
92
- * unit tests:
93
- * Run tests - ` npm run test:unit `
94
- * Run tests with coverage - ` npm run test:unit:cov `
95
- * Run tests in ` watch ` mode - ` npm run test:unit:watch `
96
-
97
- * e2e tests:
98
- * Prepare environment - ` docker-compose -f docker-compose.test.yaml up -d `
99
- * Run tests - ` npm run test:e2e `
92
+ * Prepare environment - ` docker-compose -f docker-compose.test.yaml up -d `
93
+ * Run tests - ` npm run test:unit `
94
+ * Run tests with coverage - ` npm run test:unit:cov `
100
95
101
-
102
96
* ** Libraries checking**
103
97
104
98
* Show new libraries' versions - ` npm run lib:check `
105
- * Upgrade libraries' versions - ` npm run lib:upgrade `
106
-
107
- * ** IDE configuring**
108
- * [ Run application in the IntelliJ IDEA] ( ./asset/IdeaApplicationLaunchConfiguration.png )
109
- * [ Run unit tests in the IntelliJ IDEA] ( ./asset/IdeaUnitTestConfiguration.png )
99
+ * Upgrade libraries' versions - ` npm run lib:upgrade `
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 6
6
"rootDir" : " ." ,
7
7
"verbose" : true ,
8
8
"testEnvironment" : " node" ,
9
- "testRegex" : " test/unit/ .*.spec.ts" ,
9
+ "testRegex" : " ./ test/.*.spec.ts$ " ,
10
10
"coverageReporters" : [
11
11
" json-summary" ,
12
12
" text" ,
13
13
" lcov"
14
14
],
15
- "coverageDirectory" : " .unit-test " ,
15
+ "coverageDirectory" : " .coverage " ,
16
16
"collectCoverageFrom" : [
17
17
" src/**/*.ts"
18
18
],
Original file line number Diff line number Diff line change 8
8
"copy:local-env" : " cp ./env/local.app.env ./dist/.env" ,
9
9
"start" : " node ./dist/Main.js" ,
10
10
"start:local" : " npm run copy:local-env && cd ./dist && node -r dotenv/config Main.js" ,
11
- "test:unit" : " jest --config jest.unit.json" ,
12
- "test:unit:watch" : " jest --config jest.unit.json --watch" ,
13
- "test:unit:cov" : " jest --config jest.unit.json --coverage" ,
14
- "test:e2e" : " jest --config jest.e2e.json" ,
11
+ "test" : " jest --config jest.json" ,
12
+ "test:cov" : " jest --config jest.json --coverage" ,
15
13
"lib:check" : " ncu" ,
16
14
"lib:upgrade" : " ncu -u && npm install" ,
17
15
"lint" : " eslint '{src,test}/**/*.ts'" ,
89
87
"uuid" : " 8.3.0"
90
88
},
91
89
"jest-junit" : {
92
- "outputDirectory" : " .unit-test "
90
+ "outputDirectory" : " .coverage "
93
91
},
94
92
"jestSonar" : {
95
93
"sonar56x" : true
Original file line number Diff line number Diff line change @@ -5,6 +5,5 @@ sonar.projectVersion=1.0.0
5
5
sonar.sources =src
6
6
sonar.tests =test
7
7
sonar.test =test/**/*.spec.ts
8
- sonar.coverage.exclusions =src/application/**,src/infrastructure/**,src/Main.ts
9
- sonar.junit.reportPaths =.unit-test/junit.xml
10
- sonar.typescript.lcov.reportPaths =.unit-test/lcov.info
8
+ sonar.junit.reportPaths =.coverage/junit.xml
9
+ sonar.typescript.lcov.reportPaths =.coverage/lcov.info
You can’t perform that action at this time.
0 commit comments