Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit fa5924d

Browse files
committed
Travis improvements
1 parent 23ccefe commit fa5924d

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

.travis.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
os: linux
22
services:
3-
- docker
3+
- docker
44
language: generic
5+
56
cache:
67
directories:
78
- node_modules
89
- "$HOME/.cache/electron"
910
- "$HOME/.cache/electron-builder"
11+
1012
before_script:
11-
- git lfs pull
13+
- git lfs pull
14+
- "export DISPLAY=:99.0"
15+
- "sh -e /etc/init.d/xvfb start"
16+
- sleep 3 # give xvfb some time to start
17+
1218
script:
13-
- |
19+
- |
1420
docker run --rm \
1521
--env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_') \
1622
-v ${PWD}:/project \
1723
-v ~/.cache/electron:/root/.cache/electron \
1824
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
1925
electronuserland/builder:wine \
20-
/bin/bash -c "npm install && npm run build && npm run test"
26+
/bin/bash -c "npm install && npm run test && npm run build"
2127
before_cache:
22-
- rm -rf $HOME/.cache/electron-builder/wine
28+
- rm -rf $HOME/.cache/electron-builder/wine
29+
2330
deploy:
2431
provider: releases
2532
api_key:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"prebuild": "mkdir prebuild-src && cp -R src/* prebuild-src/ && node prebuild-minify.js && cd prebuild-src && npm install",
1010
"build": "./node_modules/.bin/electron-builder build -wl -p never",
1111
"postbuild": "rm -R prebuild-src",
12-
"test": "find . | grep electron",
12+
"test": "./node_modules/.bin/nyc --reporter=lcov --reporter=text ./node_modules/.bin/mocha --timeout=3000",
1313
"posttest": "echo coverage/lcov.info | ./node_modules/.bin/codacy-coverage"
1414
},
1515
"repository": {

test/test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ describe('application launch', function () {
77

88
beforeEach(function () {
99
this.app = new Application({
10-
path: require("path").join(__dirname, "../build/")
10+
path: require("path").join(__dirname, "node_modules/.bin/electron")
11+
args: [
12+
require("path").join(__dirname, "src")
13+
]
1114
})
1215
return this.app.start()
1316
})

0 commit comments

Comments
 (0)