Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Allow Travis build for different Node.js versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shogun committed Mar 30, 2018
1 parent 84a35bc commit dfd8038
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
@@ -1,6 +1,7 @@
language: node_js

node_js:
- '6'
- '8.9'

dist: trusty
Expand Down
9 changes: 9 additions & 0 deletions packages/hapi-auth-udaru/test/test-server.js
@@ -1,9 +1,18 @@
const config = require('../lib/config')()
const Action = config.get('AuthConfig.Action')
const Hapi = require('hapi')
const chalk = require('chalk')

let server = null

let nodeVersion = process.versions.node.split('.')
nodeVersion.pop() // We don't care about minor

if (parseFloat(nodeVersion.join('.')) < 8.9) {
console.log(chalk.yellow('hapi-auth-udaru requires Node.js greater than 8.9.0. Exiting without errors.'))
process.exit(0)
}

module.exports = async function () {
if (server) return server

Expand Down

0 comments on commit dfd8038

Please sign in to comment.