Skip to content

Commit

Permalink
allow testing against hapi 19
Browse files Browse the repository at this point in the history
  • Loading branch information
jscheffner committed Jan 26, 2020
1 parent 89ae576 commit 5e1a6bf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ jobs:
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
hapi-19: [true, false]
exclude:
- node-version: 8.x
hapi-19: true
- node-version: 10.x
hapi-19: true
env:
HAPI_19: {{ matrix.hapi-19 }}
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
node-version: 12
- run: npm install
- run: npm test
- run: npm run test:hapi19

publish-npm:
needs: build
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "index.js",
"scripts": {
"test": "nyc ava",
"test:hapi19": "cross-env HAPI_19=true nyc ava",
"lint": "eslint test index.js test/**/*.js examples/**/*.js",
"format": "npm run lint -- --fix",
"coverage": "nyc report --reporter=text-lcov | coveralls"
Expand Down Expand Up @@ -36,11 +37,13 @@
"@hapi/hapi": "^18.3.1",
"ava": "^3.1.0",
"coveralls": "^3.0.6",
"cross-env": "^7.0.0",
"eslint": "^5.3.0",
"eslint-config-airbnb": "^17.1.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3",
"hapi19": "npm:@hapi/hapi@^19.0.5",
"nyc": "^15.0.0"
},
"ava": {
Expand Down
5 changes: 0 additions & 5 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ const { AggregateError } = require('p-any');
const { isBoom } = require('@hapi/boom');
const { setup: setupAll, setupServerAndPlugin, request } = require('./utils');

test('register plugin and create strategy', async (t) => {
const server = await setupServerAndPlugin();
t.is(typeof server.auth._schemes.any, 'function');
});

test('fail if all fail', async (t) => {
const server = await setupAll([false, false, false]);
const { statusCode, result } = await request(server);
Expand Down
3 changes: 2 additions & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const hapi = require('@hapi/hapi');
// eslint-disable-next-line import/no-dynamic-require
const hapi = require(process.env.HAPI_19 === 'true' ? 'hapi19' : '@hapi/hapi');
const boom = require('@hapi/boom');
const anyAuth = require('../');

Expand Down

0 comments on commit 5e1a6bf

Please sign in to comment.