Skip to content

Commit

Permalink
chore(package): update dependencies and fix related issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jun 21, 2017
1 parent cfdfd04 commit c46ce4e
Show file tree
Hide file tree
Showing 5 changed files with 2,603 additions and 19 deletions.
40 changes: 40 additions & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
'use strict'

/*
* adonis-framework
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

const semver = require('semver')
const { spawn } = require('child_process')
const spawnArgs = []

if (semver.lt(process.version, '8.0.0')) {
spawnArgs.push('--harmony-async-await')
}

function local () {
spawnArgs.push('./node_modules/.bin/japa')
const tests = spawn('node', spawnArgs)
tests.stdout.on('data', (data) => process.stdout.write(data))
tests.stderr.on('data', (data) => process.stderr.write(data))
tests.on('close', (code) => process.exit(code))
}

function win () {
spawnArgs.push('./node_modules/japa-cli/index.js')
const tests = spawn('node', spawnArgs)
tests.stdout.on('data', (data) => process.stdout.write(data))
tests.stderr.on('data', (data) => process.stderr.write(data))
tests.on('close', (code) => process.exit(code))
}

if (process.argv.indexOf('--local') > -1) {
local()
} else if (process.argv.indexOf('--win') > -1) {
win()
}
5 changes: 5 additions & 0 deletions japaFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict'

const cli = require('japa/cli')
cli.run('test/**/*.spec.js')
cli.filter('test/**/*.async.spec.js')
Loading

0 comments on commit c46ce4e

Please sign in to comment.