-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from onebeyond/chore/release-2.0
Chore: Release 2.0
- Loading branch information
Showing
12 changed files
with
5,404 additions
and
665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Node.js Publish | ||
|
||
on: | ||
release: | ||
types: [ created ] | ||
|
||
jobs: | ||
publish-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- run: npm ci | ||
- name: Publish | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | ||
npm publish --ignore-scripts --access public | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x, 16.x, 18.x, 19.x] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm ci | ||
- run: npm run lint | ||
- run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Code Climate Test Reporter | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
code-climate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
- run: npm ci | ||
- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
- run: chmod +x ./cc-test-reporter | ||
- run: ./cc-test-reporter before-build | ||
- run: npm run test:coverage | ||
- run: ./cc-test-reporter format-coverage -t lcov coverage/lcov.info | ||
- run: ./cc-test-reporter upload-coverage | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
14.0.0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = jest.fn(({ shouldThrowAnError } = {}) => { | ||
if (shouldThrowAnError) { | ||
throw new Error('Error thrown by the mock') | ||
} | ||
return { | ||
destroy: jest.fn() | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
const systemicKnext = require('../index') | ||
|
||
describe('All Schema files validation', () => { | ||
let knexInstance | ||
|
||
beforeAll(() => { | ||
knexInstance = systemicKnext() | ||
}) | ||
|
||
test('Should expose systemic compatible functions', () => { | ||
expect(knexInstance.start).toBeInstanceOf(Function) | ||
expect(knexInstance.stop).toBeInstanceOf(Function) | ||
}) | ||
|
||
test('Should expose knex instance with basic config', async () => { | ||
const knexClient = await knexInstance.start({ config: { pool: true } }) | ||
expect(knexClient.destroy).toBeTruthy() | ||
}) | ||
|
||
test('Should expose knex instance with nested knex config)', async () => { | ||
const knexClient = await knexInstance.start({ config: { knex: { pool: true } } }) | ||
expect(knexClient.destroy).toBeTruthy() | ||
}) | ||
|
||
test('Should throw an error if the config is invalid', async () => { | ||
await expect(knexInstance.start({ config: { shouldThrowAnError: true } })).rejects.toThrow() | ||
}) | ||
|
||
test.todo('Should stop destroying the pool') | ||
test.todo('Should stop without destroying the pool') | ||
test.todo('Should include a pool if the config use a compatible client (mysql, pg..)') | ||
}) |
Oops, something went wrong.