Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from electron/add-tests
Add initial tests
- Loading branch information
Showing
7 changed files
with
123 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,7 @@ npm-debug.log | |
script/ | ||
spec/ | ||
src/ | ||
test/ | ||
script/ | ||
.travis.yml | ||
appveyor.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
sudo: required | ||
|
||
os: | ||
- linux | ||
- osx | ||
|
||
dist: trusty | ||
|
||
osx_image: xcode8 | ||
|
||
language: node_js | ||
|
||
node_js: | ||
- '4' | ||
|
||
cache: | ||
- apt: true | ||
|
||
before_install: script/ci-setup.sh | ||
|
||
env: | ||
global: | ||
# prevent wine popup dialogs about installing additional packages | ||
- WINEDLLOVERRIDES="mscoree,mshtml=" | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
notifications: | ||
email: | ||
on_success: never | ||
on_failure: change |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
build: off | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
skip_tags: true | ||
|
||
install: | ||
- ps: Install-Product node LTS | ||
- npm install npm | ||
- .\node_modules\.bin\npm install | ||
|
||
test_script: | ||
- node --version | ||
- .\node_modules\.bin\npm --version | ||
- .\node_modules\.bin\npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash -xe | ||
|
||
case "$TRAVIS_OS_NAME" in | ||
"linux") | ||
sudo dpkg --add-architecture i386 | ||
sudo apt-get update | ||
sudo apt-get install -y wine1.6 | ||
;; | ||
"osx") | ||
npm install wine-darwin@1.9.17-1 | ||
# Setup ~/.wine by running a command | ||
./node_modules/.bin/wine hostname | ||
;; | ||
esac |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var assert = require('assert') | ||
var fs = require('fs') | ||
var path = require('path') | ||
var rcedit = require('..') | ||
var rcinfo = require('rcinfo') | ||
var temp = require('temp').track() | ||
|
||
describe('rcedit(exePath, options, callback)', function () { | ||
this.timeout(60000) | ||
|
||
var exePath = null | ||
|
||
beforeEach(function () { | ||
exePath = path.join(temp.mkdirSync('node-rcedit-'), 'electron.exe') | ||
var fixturesExePath = path.join(__dirname, 'fixtures', 'electron.exe') | ||
fs.writeFileSync(exePath, fs.readFileSync(fixturesExePath)) | ||
}) | ||
|
||
it('updates the information in the executable', function (done) { | ||
var options = { | ||
'version-string': { | ||
CompanyName: 'Umbrella', | ||
FileDescription: 'Vanhouten', | ||
LegalCopyright: 'Maritime', | ||
ProductName: 'Millhouse' | ||
}, | ||
'file-version': '3.4.5.6', | ||
'product-version': '4.5.6.7' | ||
} | ||
rcedit(exePath, options, function (error) { | ||
if (error != null) return done(error) | ||
|
||
rcinfo(exePath, function (error, info) { | ||
if (error != null) return done(error) | ||
|
||
assert.equal(info.CompanyName, 'Umbrella') | ||
assert.equal(info.FileDescription, 'Vanhouten') | ||
assert.equal(info.LegalCopyright, 'Maritime') | ||
assert.equal(info.ProductName, 'Millhouse') | ||
assert.equal(info.FileVersion, '3.4.5.6') | ||
assert.equal(info.ProductVersion, '4.5.6.7') | ||
|
||
done() | ||
}) | ||
}) | ||
}) | ||
}) |