Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/fastify-routes-3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
davidebianchi authored Aug 5, 2020
2 parents f33df22 + 85136d2 commit c3665a9
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 17 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm run build --if-present
- run: npm test
- run: npm run coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To works correctly, this library needs some specific environment variables:
* `BACKOFFICE_HEADER_KEY`
* `MICROSERVICE_GATEWAY_SERVICE_NAME`

When creating a new service from Mia-Platform DevOps Console, they come already defined but you can always change or add them anytime as described [in the DevOps console documentation](https://docs.mia-platform.eu/development_suite/api-console/api-design/services#environment-variable-configuration).
When creating a new service from Mia-Platform DevOps Console, they come already defined but you can always change or add them anytime as described [in the DevOps console documentation](https://docs.mia-platform.eu/development_suite/api-console/api-design/services/#environment-variable-configuration).
In local, the environment variables are defined
in this [file](examples/default.env).

Expand Down
19 changes: 14 additions & 5 deletions tests/serviceBuilder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,20 @@ tap.test('serviceBuilder', test => {
})

innerTest.test('on TCP error rejects the promise', async assert => {
nock.enableNetConnect('unresolved-hostname-i-hope-so')
const service = serviceBuilder('unresolved-hostname-i-hope-so')
const myServiceNameScope = nock('http://unresolved-hostname')
.get('/foo')
.replyWithError({
code: 'ENOTFOUND',
})
const service = serviceBuilder('unresolved-hostname')

try {
await service.get('/foo')
assert.fail('We can\'t reach this!')
} catch (error) {
assert.equal(error.code, 'ENOTFOUND')
}
myServiceNameScope.done()
assert.end()
})

Expand Down Expand Up @@ -621,16 +626,20 @@ tap.test('serviceBuilder', test => {
})

innerTest.test('on TCP error rejects the promise', async assert => {
nock.enableNetConnect('unresolved-hostname-i-hope-so')

const service = serviceBuilder('unresolved-hostname-i-hope-so')
const myServiceNameScope = nock('http://unresolved-hostname')
.post('/foo')
.replyWithError({
code: 'ENOTFOUND',
})
const service = serviceBuilder('unresolved-hostname')

try {
await service.post('/foo', { the: 'sent body' }, {}, { returnAs: 'BUFFER' })
assert.fail('We can\'t reach this!')
} catch (error) {
assert.equal(error.code, 'ENOTFOUND')
}
myServiceNameScope.done()
assert.end()
})

Expand Down

0 comments on commit c3665a9

Please sign in to comment.