Skip to content

Commit

Permalink
Added circle ci
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-tunerlabs committed Jun 1, 2021
1 parent 7061a86 commit 4172017
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: 2.17
jobs:
build:
docker:
- image: circleci/node:10.0.0
working_directory: ~/project/
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: update-npm
command: 'sudo npm install -g npm@latest'
- run:
name: install-npm
command: npm install
- save_cache:
key: dependency-cache-{{checksum "package.json"}}
paths:
- ./node_modules
- run:
name: Executing unit test cases
command: npm test

- run:
name: Install sonar scanner
command: 'sudo npm install -g sonarqube-scanner'

- run:
name: Sonar scanner
command: |
sonar-scanner
workflows:
version: 2
build_and_test:
jobs:
- build
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"migrations": "module/migrations/bin/migrations.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "mocha --timeout 10000",
"start": "node app.js",
"dev": "nodemon app.js"
},
Expand Down Expand Up @@ -59,7 +59,10 @@
"require-all": "^2.2.0",
"uuid": "^3.3.2",
"yaml-js": "^0.1.3",
"jwt-decode": "^2.2.0"
"jwt-decode": "^2.2.0",
"chai": "^4.2.0",
"chai-http": "^4.3.0",
"mocha": "^6.2.2"
},
"devDependencies": {}
}
13 changes: 13 additions & 0 deletions test/solutions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let server = require("../app");
let chai = require("chai");
let chaiHttp = require("chai-http");

// Assertion
chai.should();
chai.use(chaiHttp);

describe('Solutions APIs', () => {
it("Test 400 error for solution details api", (done) => {
done();
});
})

0 comments on commit 4172017

Please sign in to comment.