Giter Club home page Giter Club logo

testron's Introduction

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) 2015 Kyle Robinson Young. MIT License

testron's People

Contributors

shama avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.