File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 "lint:fix" : " eslint --quiet --fix src test" ,
2727 "prepare" : " husky install" ,
2828 "test" : " npm run test:unit && npm run test:integ" ,
29- "test:unit" : " APP_CONFIG=./test/unit/utils/.app.json mocha test/unit/*.spec.js test/unit/**/*.spec.js test/unit/**/*.spec.js test/unit/**/**/*.spec.js --timeout=3000" ,
29+ "test:unit" : " APP_CONFIG=./test/unit/utils/.app.json APP_CONFIG1=./test/unit/utils/.app1.json mocha test/unit/*.spec.js test/unit/**/*.spec.js test/unit/**/*.spec.js test/unit/**/**/*.spec.js --timeout=3000" ,
3030 "test:integ" : " mocha test/integration/*.spec.js test/integration/**/*.spec.js --timeout=3000" ,
3131 "printReportsLink" : " echo Detailed unit test coverage report: file:///$(pwd)/coverage-unit/index.html && echo Detailed integration test coverage report: file:///$(pwd)/coverage-integration/index.html" ,
3232 "cover" : " npm run cover:unit" ,
Original file line number Diff line number Diff line change 11{
2- "port" : " 5000 " ,
2+ "port" : " 3000 " ,
33 "authKey" : " YWxhZGRpbjpvcGVuc2VzYW1l" ,
44 "allowPublicAccess" : false ,
55 "mysql" : {
Original file line number Diff line number Diff line change 1+ {
2+ "authKey" : " YWxhZGRpbjpvcGVuc2VzYW1l" ,
3+ "allowPublicAccess" : false ,
4+ "mysql" : {
5+ "host" : " localhost" ,
6+ "port" : " 3306" ,
7+ "database" : " testdb" ,
8+ "user" : " root" ,
9+ "password" : " 1234"
10+ }
11+ }
Original file line number Diff line number Diff line change @@ -32,16 +32,17 @@ describe('unit Tests', function () {
3232
3333 } ) ;
3434 it ( 'default port should be 5000' , function ( ) {
35+ const backup = process . env . APP_CONFIG ;
36+ process . env . APP_CONFIG = process . env . APP_CONFIG1 ;
37+ deleteAppConfig ( ) ;
3538 let configs = getConfigs ( ) ;
36- _verifyConfigs ( configs ) ;
37- configs = getConfigs ( ) ;
38- // call verify config second time
39- _verifyConfigs ( configs ) ;
39+ expect ( configs . port ) . to . eql ( '5000' ) ;
40+ process . env . APP_CONFIG = backup ;
4041 } ) ;
4142} ) ;
4243
4344function _verifyConfigs ( configs ) {
44- expect ( configs . port ) . to . eql ( '5000 ' ) ;
45+ expect ( configs . port ) . to . eql ( '3000 ' ) ;
4546 expect ( configs . authKey . length ) . to . eql ( 24 ) ;
4647 expect ( configs . mysql . port ) . to . eql ( '3306' ) ;
4748 expect ( configs . mysql . user . length ) . to . gt ( 0 ) ;
You can’t perform that action at this time.
0 commit comments