const Application = require('spectron').Application
const assert = require('assert')
const path = require('path')

describe('application launch', function() {
  this.timeout(10000)

  beforeEach(function() {
    this.app = new Application({
      path: path.join(__dirname, '..', 'node_modules', '.bin', 'electron'),
      args: [path.join(__dirname, '..', 'src')]
    })
    return this.app.start()
  })

  afterEach(function() {
    if (this.app && this.app.isRunning()) {
      return this.app.stop()
    }
  })

  it('shows an initial window', function() {
    return this.app.client.getWindowCount().then(function(count) {
      assert.equal(count, 1)
    })
  })

  it('renders sarah', function() {
    return this.app.client.getText('p').then(text => {
      assert.equal('sarah', text)
    })
  })
})

const Application = require('spectron').Application
const assert = require('assert')
const path = require('path')

describe('application launch', function() {
  this.timeout(10000)

  beforeEach(function() {
    this.app = new Application({
      path: path.join(__dirname, '..', 'node_modules', '.bin', 'electron'),
      args: [path.join(__dirname, '..', 'src', 'main.js')],
    })
    return this.app.start()
  })

  afterEach(function() {
    if (this.app && this.app.isRunning()) {
      return this.app.stop()
    }
  })

  it('shows an initial window', function() {
    return this.app.client.getWindowCount().then(function(count) {
      assert.equal(count, 1)
    })
  })

  it('renders sarah', function() {
    return this.app.client.getText('p').then(text => {
      assert.equal('sarah', text)
    })
  })
})

Fix bad test runner setup