Skip to content

Commit

Permalink
Merge branch 'release/1.0.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
davesag committed Jun 4, 2020
2 parents 3a17203 + 3409e54 commit 5548654
Show file tree
Hide file tree
Showing 9 changed files with 2,011 additions and 1,961 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ I write a lot of APIs and have distilled my current best-practice into this code

## What do you do with it?

This is a GitHUb Template so either click the ['use this template'](https://github.com/davesag/api-server-boilerplate/generate) button above, or clone this rep, or fork it, nuke the existing `.git` data and replace with your own `git init` and `git flow init` edit the `README.md` file, add your own details to `api.yml` and add routes to `src/api/` as you like.
This is a GitHub Template so either click the ['use this template'](https://github.com/davesag/api-server-boilerplate/generate) button above, or clone this rep, or fork it, nuke the existing `.git` data and replace with your own `git init` and `git flow init` edit the `README.md` file, add your own details to `api.yml` and add routes to `src/api/` as you like.

## What's included?

Expand Down
3,895 changes: 1,976 additions & 1,919 deletions package-lock.json

Large diffs are not rendered by default.

55 changes: 28 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@davesag/api-server-boilerplate",
"version": "1.0.11",
"description": "Dave Sag's boilerplate code for a swagger based API server",
"version": "1.0.12",
"description": "Boilerplate code for a swagger based API server",
"author": "Dave Sag <davesag@gmail.com>",
"type": "commonjs",
"license": "MIT",
Expand All @@ -19,7 +19,7 @@
"test": "test"
},
"scripts": {
"eslint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
"eslint-check": "eslint --print-config src/index.js | eslint-config-prettier-check",
"lint": "eslint .",
"prettier": "prettier --write '**/*.{js,json,md}'",
"start": "NODE_PATH=. node index.js",
Expand Down Expand Up @@ -54,48 +54,49 @@
"http-status-codes": "^1.4.0",
"node-http-error": "^2.0.0",
"route-async": "^1.0.7",
"swagger-routes-express": "^3.1.2",
"swagger-ui-express": "^4.1.2",
"swagger-routes-express": "^3.1.3",
"swagger-ui-express": "^4.1.4",
"traverse-folders": "^1.1.2",
"yamljs": "^0.3.0"
},
"devDependencies": {
"@stryker-mutator/core": "^2.4.0",
"@stryker-mutator/javascript-mutator": "^2.4.0",
"@stryker-mutator/mocha-framework": "^2.4.0",
"@stryker-mutator/mocha-runner": "^2.4.0",
"@stryker-mutator/core": "^3.2.4",
"@stryker-mutator/javascript-mutator": "^3.2.4",
"@stryker-mutator/mocha-framework": "^3.2.4",
"@stryker-mutator/mocha-runner": "^3.2.4",
"chai": "^4.2.0",
"chai-almost": "^1.0.1",
"chai-as-promised": "^7.1.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-mocha": "^6.2.2",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-prettier": "^3.1.2",
"eslint": "^7.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-mocha": "^7.0.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"husky": "^3.1.0",
"lint-staged": "^9.5.0",
"mocha": "^6.2.2",
"mock-req-res": "^1.1.4",
"nyc": "^15.0.0",
"prettier": "^1.19.1",
"husky": "^4.2.5",
"lint-staged": "^10.2.8",
"mocha": "^7.2.0",
"mock-req-res": "^1.2.0",
"nyc": "^15.1.0",
"prettier": "^2.0.5",
"proxyquire": "^2.1.3",
"sinon": "^8.0.1",
"sinon-chai": "^3.4.0",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0",
"supertest": "^4.0.2"
},
"prettier": {
"semi": false,
"singleQuote": true,
"proseWrap": "never"
"proseWrap": "never",
"arrowParens": "avoid",
"trailingComma": "none"
},
"lint-staged": {
"**/*.{js,json,md}": [
"prettier --write",
"git add"
"prettier --write"
]
},
"husky": {
Expand Down
2 changes: 1 addition & 1 deletion stryker.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function(config) {
module.exports = function (config) {
config.set({
mutate: [
'src/**/*.js',
Expand Down
4 changes: 1 addition & 3 deletions test/server/routes/ping.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ describe('GET /ping', () => {
})

it('returns an Okay result and status code 200', async () => {
const res = await request(server)
.get('/ping')
.expect(200)
const res = await request(server).get('/ping').expect(200)

expect(res.body).to.have.property('name', name)
expect(res.body).to.have.property('description', description)
Expand Down
4 changes: 1 addition & 3 deletions test/server/routes/root.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ describe('GET /', () => {
})

it('returns the expected values with status code 200', async () =>
request(server)
.get('/')
.expect(200, expected))
request(server).get('/').expect(200, expected))
})
4 changes: 1 addition & 3 deletions test/server/routes/v1/hello.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ describe('GET /api/v1/hello/:name', () => {
const expected = `"hello ${name}"`

it('returns the expected value with status code 200', async () =>
request(server)
.get(`/api/v1/hello/${name}`)
.expect(200, expected))
request(server).get(`/api/v1/hello/${name}`).expect(200, expected))
})

context('given an invalid name', () => {
Expand Down
4 changes: 1 addition & 3 deletions test/server/routes/v1/snooze.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ describe('GET /api/v1/snooze', () => {
})

it('returns status code 200', async () =>
request(server)
.get('/api/v1/snooze')
.expect(200))
request(server).get('/api/v1/snooze').expect(200))
})
2 changes: 1 addition & 1 deletion test/unit/utils/genericErrors.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('src/utils/genericErrors', () => {
})

context('when path is unknown', () => {
const req = mockRequest()
const req = mockRequest({ path: undefined })

before(() => {
genericErrors(error, req, res, next)
Expand Down

0 comments on commit 5548654

Please sign in to comment.