Skip to content

Commit

Permalink
Added dxos/browser-runner for browser testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchoz49 committed May 26, 2020
1 parent 211b40f commit fa10329
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 64 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
language: node_js
node:
- lts/*
services: xvfb
3 changes: 1 addition & 2 deletions bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ function benchRead () {
if (err) throw err
if (offset >= 512 * 1024 * 1024) {
console.timeEnd('512mb read')
console.log('BROWSER_RUNNER_EXIT')
return
return process.exit(0) // we do this to close browser-runner
}
st.read(offset += buf.length, 65536, onread)
})
Expand Down
17 changes: 17 additions & 0 deletions browser-runner.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const finished = require('tap-finished')

let stream = null

module.exports = {
beforeAll ({ shutdown }) {
stream = finished(function (results) {
if (results.ok) {
return shutdown(0)
}
shutdown(1)
})
},
onMessage (msg) {
stream.write(msg + '\n')
}
}
57 changes: 0 additions & 57 deletions browser-runner.js

This file was deleted.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@
"random-access-storage": "^1.3.0"
},
"devDependencies": {
"budo": "^11.6.3",
"puppeteer": "^3.0.2",
"@dxos/browser-runner": "1.0.0-beta.6",
"random-access-test": "^1.0.0",
"standard": "^11.0.1",
"tap-finished": "0.0.1",
"tape": "^5.0.0"
},
"scripts": {
"test": "node browser-runner.js test.js",
"test": "browser-runner test.js",
"posttest": "npm run lint",
"lint": "standard",
"bench": "node browser-runner.js bench.js"
"bench": "browser-runner bench.js"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit fa10329

Please sign in to comment.