Skip to content

Commit cdc3f5e

Browse files
committed
💚 Test spec
1 parent 588313e commit cdc3f5e

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
os:
2+
- osx
3+
language: node_js
4+
node_js:
5+
- '6.3.1'
6+
cache:
7+
directories:
8+
- node_modules
9+
notifications:
10+
email:
11+
on_success: never
12+
on_failure: change

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Juno](http://randompaper.co.s3.amazonaws.com/juno/header.png)
22

3-
[![GitHub release](https://img.shields.io/github/release/uetchy/juno.svg?maxAge=2592000)](https://github.com/uetchy/juno/releases/latest) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/uetchy/juno/master/LICENSE) [![GitHub stars](https://img.shields.io/github/stars/uetchy/juno.svg)](https://github.com/uetchy/juno/stargazers) [![GitHub issues](https://img.shields.io/github/issues/uetchy/juno.svg)](https://github.com/uetchy/juno/issues) [![Join the chat at https://gitter.im/uetchy/juno](https://badges.gitter.im/uetchy/juno.svg)](https://gitter.im/uetchy/juno?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Twitter](https://img.shields.io/twitter/url/http/github.com/uetchy/juno.svg?style=social)](https://twitter.com/intent/tweet?text=uetchy/juno – Jupyter Notebook stays on macOS menubar.&url=https://github.com/uetchy/juno)
3+
[![GitHub release](https://img.shields.io/github/release/uetchy/juno.svg?maxAge=2592000)](https://github.com/uetchy/juno/releases/latest) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/uetchy/juno/master/LICENSE) [![GitHub issues](https://img.shields.io/github/issues/uetchy/juno.svg)](https://github.com/uetchy/juno/issues) [![Join the chat at https://gitter.im/uetchy/juno](https://badges.gitter.im/uetchy/juno.svg)](https://gitter.im/uetchy/juno?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/uetchy/juno.svg?branch=master)](https://travis-ci.org/uetchy/juno) [![Twitter](https://img.shields.io/twitter/url/http/github.com/uetchy/juno.svg?style=social)](https://twitter.com/intent/tweet?text=uetchy/juno – Jupyter Notebook stays on macOS menubar.&url=https://github.com/uetchy/juno)
44

55
Jupyter Notebook stays on macOS menubar. Powered by Electron.
66

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"repository": "uetchy/juno",
1010
"electronVersion": "1.2.8",
1111
"scripts": {
12-
"test": "xo",
12+
"test": "mocha && xo",
1313
"start": "electron .",
1414
"build": "electron-packager . $npm_package_productName --out=dist --ignore='^/dist$' --prune --asar --platform=darwin --arch=x64 --version=$npm_package_electronVersion --app-version=$npm_package_version --icon=./assets/app.icns --overwrite",
1515
"postbuild": "node scripts/post-build-mac.js",
@@ -22,8 +22,10 @@
2222
"devDependencies": {
2323
"electron-packager": "^7.3.0",
2424
"electron-prebuilt": "^1.2.8",
25+
"mocha": "^3.0.1",
2526
"npm-run-all": "^2.3.0",
2627
"plist": "^1.2.0",
28+
"spectron": "^3.3.0",
2729
"xo": "^0.16.0"
2830
},
2931
"xo": {

test/electron.spec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const assert = require('assert')
2+
const Application = require('spectron').Application
3+
4+
describe('application launch', function () {
5+
this.timeout(10000)
6+
7+
beforeEach(function () {
8+
this.app = new Application({
9+
path: './node_modules/electron-prebuilt/dist/Electron.app/Contents/MacOS/Electron',
10+
args: ['.']
11+
})
12+
return this.app.start()
13+
})
14+
15+
afterEach(function () {
16+
if (this.app && this.app.isRunning()) {
17+
return this.app.stop()
18+
}
19+
})
20+
21+
it('shows an initial window', function () {
22+
return this.app.client.getWindowCount().then(count => {
23+
assert.equal(count, 1)
24+
})
25+
})
26+
})

0 commit comments

Comments
 (0)