From 2059894b0701785b534a2e306ca1e9ed7ba4c688 Mon Sep 17 00:00:00 2001 From: Luke Bellamy Date: Wed, 31 Jul 2019 14:21:08 +0100 Subject: [PATCH 1/4] zip artifacts --- .circleci/config.yml | 7 +++++++ .mocha/config.json | 4 ++-- test/Utils/PathHandler.spec.ts | 16 +++++++--------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b2d276..5cc1faa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,6 +64,13 @@ jobs: - store_test_results: path: reports + - run: + name: Compress Artifacts + command: tar -cvf ./results.tar ./results + + - store_artifacts: + path: ./reports.tar + - store_artifacts: path: ./reports/junit-custom.xml diff --git a/.mocha/config.json b/.mocha/config.json index f664bc9..97d3654 100644 --- a/.mocha/config.json +++ b/.mocha/config.json @@ -1,9 +1,9 @@ { "reporterEnabled": "spec, mochawesome, mocha-junit-reporter", "mochawesomeReporterOptions": { - "reportDir": "report" + "reportDir": "reports/mocha" }, "mochaJunitReporterReporterOptions": { - "mochaFile": "results/junit-custom.xml" + "mochaFile": "reports/junit-custom.xml" } } \ No newline at end of file diff --git a/test/Utils/PathHandler.spec.ts b/test/Utils/PathHandler.spec.ts index a90c692..d03f04b 100644 --- a/test/Utils/PathHandler.spec.ts +++ b/test/Utils/PathHandler.spec.ts @@ -29,15 +29,13 @@ describe('PathHandler', function() { describe('RegisterProxy', function() { let serverObject: CustomServer; - before(done => { - let isDone = false; - chai.use(chaiHttp); - serverObject = new CustomServer({ PORT: 8081, APP_BUILD: 1, APP_VERSION: '1', SERVICE_NAME: 'Test' }); - ExpressServer.events.on(ServerEvents.SERVER_READY, () => { - if (!isDone) { - done(); - isDone = true; - } + before(() => { + return new Promise(resolve => { + chai.use(chaiHttp); + serverObject = new CustomServer({ PORT: 8081, APP_BUILD: 1, APP_VERSION: '1', SERVICE_NAME: 'Test' }); + ExpressServer.events.on(ServerEvents.SERVER_READY, () => { + resolve(); + }); }); }); From 94a3027871066044f5e4825a5248a0443cde7ef5 Mon Sep 17 00:00:00 2001 From: Luke Bellamy Date: Wed, 31 Jul 2019 14:25:12 +0100 Subject: [PATCH 2/4] oopsie --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5cc1faa..8f7bbeb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,7 +66,7 @@ jobs: - run: name: Compress Artifacts - command: tar -cvf ./results.tar ./results + command: tar -cvf ./reports.tar ./reports - store_artifacts: path: ./reports.tar From 4e3a7154be56bd0d112fee828c38bbcc899f6637 Mon Sep 17 00:00:00 2001 From: Luke Bellamy Date: Wed, 31 Jul 2019 14:30:50 +0100 Subject: [PATCH 3/4] Added badges --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 7d152c4..ec0fdba 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,10 @@ This is a framework for building a microservice with express JS +[![CircleCI](https://circleci.com/gh/lukebellamy053/node-express-microservice/tree/master.svg?style=svg)](https://circleci.com/gh/lukebellamy053/node-express-microservice/tree/master) +[![Maintainability](https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/maintainability)](https://codeclimate.com/github/codeclimate/codeclimate/maintainability) + + ## Installation Newer versions of NPM save the package to your package.json by default ```sh From 3c4f8e9b340a10a6f8c8e72eb67674555ecd1c8d Mon Sep 17 00:00:00 2001 From: Luke Bellamy Date: Wed, 31 Jul 2019 14:31:55 +0100 Subject: [PATCH 4/4] correct badges --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ec0fdba..b21b402 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ This is a framework for building a microservice with express JS [![CircleCI](https://circleci.com/gh/lukebellamy053/node-express-microservice/tree/master.svg?style=svg)](https://circleci.com/gh/lukebellamy053/node-express-microservice/tree/master) -[![Maintainability](https://api.codeclimate.com/v1/badges/a99a88d28ad37a79dbf6/maintainability)](https://codeclimate.com/github/codeclimate/codeclimate/maintainability) - +[![Maintainability](https://api.codeclimate.com/v1/badges/8f19766e87bd425fb5b6/maintainability)](https://codeclimate.com/github/lukebellamy053/node-express-microservice/maintainability) + ## Installation Newer versions of NPM save the package to your package.json by default