mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-09-05 07:28:42 +08:00
First beta version
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
// Set BABEL_ENV to use proper env config
|
||||
process.env.BABEL_ENV = 'test'
|
||||
|
||||
// Enable use of ES6+ on required files
|
||||
require('babel-register')({
|
||||
ignore: /node_modules/
|
||||
})
|
||||
|
||||
// Attach Chai APIs to global scope
|
||||
const { expect, should, assert } = require('chai')
|
||||
global.expect = expect
|
||||
global.should = should
|
||||
global.assert = assert
|
||||
|
||||
// Require all JS files in `./specs` for Mocha to consume
|
||||
require('require-dir')('./specs')
|
||||
@@ -0,0 +1,13 @@
|
||||
import utils from '../utils'
|
||||
|
||||
describe('Launch', function () {
|
||||
beforeEach(utils.beforeEach)
|
||||
afterEach(utils.afterEach)
|
||||
|
||||
it('shows the proper application title', function () {
|
||||
return this.app.client.getTitle()
|
||||
.then(title => {
|
||||
expect(title).to.equal('picgo')
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,23 @@
|
||||
import electron from 'electron'
|
||||
import { Application } from 'spectron'
|
||||
|
||||
export default {
|
||||
afterEach () {
|
||||
this.timeout(10000)
|
||||
|
||||
if (this.app && this.app.isRunning()) {
|
||||
return this.app.stop()
|
||||
}
|
||||
},
|
||||
beforeEach () {
|
||||
this.timeout(10000)
|
||||
this.app = new Application({
|
||||
path: electron,
|
||||
args: ['dist/electron/main.js'],
|
||||
startTimeout: 10000,
|
||||
waitTimeout: 10000
|
||||
})
|
||||
|
||||
return this.app.start()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user