Skip to content

Commit

Permalink
Fix tests (#96)
Browse files Browse the repository at this point in the history
Closes #63

- Switch from testling to jsdom for browser APIs
- Switch from coverify to nyc for coverage reports
- Clean up related dead code and tooling
- Update Travis to use Node v6 and v8, since we need ES6 features for jsdom.
  • Loading branch information
BehindTheMath authored Jan 8, 2018
1 parent 6491e32 commit a2e6cfc
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 12,532 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules/
tests/scripts/index.html
pjax.js
.nyc_output/
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
language: "node_js"
before_script:
# testling use headless browser
# on travis-ci, firefox is the default one
# & it needs a display to works
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
node_js:
- "6"
- "8"
35 changes: 10 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,29 @@
],
"devDependencies": {
"browserify": "^3.46.0",
"coverify": "^1.0.6",
"jscs": "^1.6.2",
"jsdom": "^11.5.1",
"jsdom-global": "^3.0.2",
"jshint": "^2.5.6",
"npmpub": "^3.1.0",
"nyc": "^11.4.1",
"opn-cli": "^3.1.0",
"serve": "1.4.0",
"tape": "^3.0.0",
"testling": "^1.6.1"
"tap-nyc": "^1.0.3",
"tap-spec": "^4.1.1",
"tape": "^3.0.0"
},
"scripts": {
"lint": "jscs **/*.js && jshint . --exclude-path .gitignore",
"standalone": "browserify index.js --standalone Pjax > pjax.js",
"build-debug": "browserify index.js --debug --standalone Pjax > pjax.js",
"tests": "testling",
"test": "npm run lint && npm run standalone && npm run tests",
"test--html": "testling --html > tests/scripts/index.html",
"coverage": "browserify -t coverify tests/**/*.js | testling | coverify",
"tests": "tape -r ./tests/index.js ./tests/**/*.js",
"test": "npm run lint && npm run tests | tap-spec",
"coverage-tests": "npm run tests | tap-nyc",
"coverage": "nyc -x \"tests/**\" npm run coverage-tests",
"example": "opn http://localhost:3000/example/; serve .",
"prepublish": "npm run standalone",
"#release": "testling does not work in a process launch by npm... :facepalm:",
"release": "echo \"npmpub --skip-test --dry && npm test && npmpub --skip-test --skip-cleanup\""
},
"testling": {
"files": "tests/**/*.js",
"browsers": [
"ie/10..latest",
"firefox/4.0",
"firefox/latest",
"firefox/nightly",
"chrome/10",
"chrome/latest",
"chrome/canary",
"opera/12..latest",
"opera/next",
"safari/5.1..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2..latest"
]
}
}
Loading

0 comments on commit a2e6cfc

Please sign in to comment.