Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.log
.DS_Store
dist
es5
node_modules
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js
node_js:
- "0.10"
- "0.12"
- "4"
- "5"
- "6"
8 changes: 7 additions & 1 deletion index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/* eslint-disable vars-on-top, global-require */

var assert = require('chai').assert;

var TestServer = require('.');
if (typeof Promise === 'undefined') {
global.Promise = require('native-promise-only');
}

var TestServer = require('./index');

// very simple http handler
var app = (req, res) => {
Expand Down
24 changes: 21 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
"description": "Test node.js HTTP servers using the fetch API",
"main": "index.js",
"scripts": {
"build": "rm -r es5 > /dev/null; babel ./*.js -d es5",
"prepublish": "npm run build",
"lint": "eslint *.js",
"mocha": "mocha *.test.js",
"test": "npm run lint && npm run mocha"
"mocha": "[ `echo $npm_config_node_version | cut -d. -f1` -eq 0 ] && mocha es5/*.test.js || mocha *.test.js",
"test": "npm run lint && npm run build && npm run mocha"
},
"repository": {
"type": "git",
Expand All @@ -33,10 +35,26 @@
"node-fetch": "^1.5.1"
},
"devDependencies": {
"babel-cli": "^6.7.7",
"babel-plugin-transform-es2015-arrow-functions": "^6.7.7",
"babel-plugin-transform-es2015-template-literals": "^6.6.5",
"babel-plugin-transform-object-assign": "^6.5.0",
"chai": "3.5.0",
"eslint": "2.8.0",
"eslint-config-airbnb-base": "1.0.4",
"eslint-plugin-import": "1.6.0",
"mocha": "2.4.5"
"mocha": "2.4.5",
"native-promise-only": "^0.8.1"
},
"files": [
"es5",
"*.js"
],
"babel": {
"plugins": [
"transform-es2015-arrow-functions",
"transform-es2015-template-literals",
"transform-object-assign"
]
}
}