-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
285 additions
and
6 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
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,35 @@ | ||
'use strict'; | ||
|
||
var resolve = require('path').resolve; | ||
var assert = require('chai').assert; | ||
var spawnBabel = require('./util/launch-utils').spawnBabel; | ||
var GET = require('./util/http-utils').GET; | ||
|
||
describe('Babel', function() { | ||
it('should run the example and respond', function(done) { | ||
this.timeout(5000); | ||
var js_file = resolve(__dirname, './test-resources/babel-base-case.js'); | ||
var target = spawnBabel(js_file); | ||
var called = false; | ||
|
||
target.stdout.on('data', function(data) { | ||
if (data.toString().indexOf('START') === -1) { | ||
return; | ||
} | ||
|
||
GET('/').then(function() { | ||
called = true; | ||
target.kill('SIGINT'); | ||
}); | ||
}); | ||
|
||
target.stderr.on('data', function(data) { | ||
console.error(data.toString()); | ||
}); | ||
|
||
target.on('close', function() { | ||
assert(called); | ||
done(); | ||
}); | ||
}); | ||
}); |
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,6 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaVersion": 2015, | ||
"sourceType": "module" | ||
} | ||
} |
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,12 @@ | ||
import express from 'express'; | ||
import Router from '../../lib/express-promise-router.js'; | ||
const router = Router(); | ||
|
||
router.get('/', function(req, res) { | ||
res.send('Hi!'); | ||
}); | ||
|
||
const app = express(); | ||
app.use(router); | ||
app.listen(12345); | ||
console.log('START'); |
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
Oops, something went wrong.