testron
CI your client side tests with Electron
Last updated 2 years ago by shama .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install testron 
SYNC missed versions from official npm registry.

testron

CI your client side tests with Electron

build status NPM version experimental

about

This uses Electron to run tests in Chromium.

usage

  • Install to your project: npm install testron --save-dev
  • Install Electron: npm install electron-prebuilt --save-dev
  • Add a test script to your package.json:
{
  "name": "my-project",
  "scripts": {
    "test": "testron test/client.js"
  },
}
  • Run npm test to run the test script in Electron

writing tests

Currently this only supports TAP. Here is an example test written using tape:

var test = require('tape')

test('test this', function (t) {
  t.plan(1)
  var ul = document.createElement('ul')
  var li = document.createElement('li')
  ul.appendChild(li)
  li.textContent = 'it works'
  t.equal(ul.outerHTML, '<ul><li>it works</li></ul>')
  t.end()
})

It is recommended bundling your tests and piping to testron:

{
  "name": "my-project",
  "scripts": {
    "test": "browserify test/client.js | testron"
  },
}

travis-ci integration

Add a .travis.yml file to your project:

language: node_js
node_js:
  - 'iojs'
before_script:
  - export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start

API

There is also an API:

var testron = require('testron')
var tests = testron('test/client.js')
tests.stdout.on('data', function (data) {
  console.log('line: ' + data.toString())
})
tests.on('exit', function () {
  console.log('Tests are done!')
})

similar projects

These are similar projects that also (can) use Electron for testing:

  • hihat
    small tool for running browser tests locally
  • zuul
    multi-framework javascript browser testing

license

(c) 2018 Kyle Robinson Young. MIT License

Current Tags

  • 1.2.1                                ...           latest (2 years ago)

4 Versions

  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 2
Dependencies (4)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |