Fixing tests

This commit is contained in:
Jeffrey Morgan 2015-01-31 01:01:06 -05:00
parent e73e1c59e4
commit cb44886925
4 changed files with 30 additions and 13 deletions

View File

@ -54,13 +54,12 @@ app.on('ready', function() {
});
mainWindow.webContents.on('did-finish-load', function() {
mainWindow.show();
mainWindow.show();
mainWindow.focus();
mainWindow.setTitle('');
// Auto Updates
if (process.env.NODE_ENV !== 'dev' && process.env.NODE_ENV !== 'test') {
if (process.env.NODE_ENV !== 'development' && !argv.test) {
autoUpdater.setFeedUrl('https://updates.kitematic.com/releases/latest?version=' + app.getVersion());
autoUpdater.on('checking-for-update', function (e) {

16
deps
View File

@ -1,17 +1,25 @@
#!/bin/bash
BASE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PLATFORM='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
PLATFORM='linux'
elif [[ "$unamestr" == 'Darwin' ]]; then
PLATFORM='darwin'
fi
export BOOT2DOCKER_CLI_VERSION=$(node -pe "JSON.parse(process.argv[1])['boot2docker-version']" "$(cat $BASE/package.json)")
export BOOT2DOCKER_CLI_VERSION_FILE=boot2docker-$BOOT2DOCKER_CLI_VERSION
export ATOM_SHELL_VERSION=$(node -pe "JSON.parse(process.argv[1])['atom-shell-version']" "$(cat $BASE/package.json)")
export ATOM_SHELL_VERSION_FILE=atom-shell-v$ATOM_SHELL_VERSION-darwin-x64.zip
export ATOM_SHELL_VERSION_FILE=atom-shell-v$ATOM_SHELL_VERSION-$PLATFORM-x64.zip
mkdir -p $BASE/cache
pushd $BASE/cache > /dev/null
mkdir -p $BASE/cache/$PLATFORM
pushd $BASE/cache/$PLATFORM > /dev/null
if [ ! -f $ATOM_SHELL_VERSION_FILE ]; then
echo "-----> Downloading atom-shell..."
rm -rf atom-shell-*
curl -L -o $ATOM_SHELL_VERSION_FILE https://github.com/atom/atom-shell/releases/download/v$ATOM_SHELL_VERSION/atom-shell-v$ATOM_SHELL_VERSION-darwin-x64.zip
curl -L -o $ATOM_SHELL_VERSION_FILE https://github.com/atom/atom-shell/releases/download/v$ATOM_SHELL_VERSION/atom-shell-v$ATOM_SHELL_VERSION-$PLATFORM-x64.zip
unzip $ATOM_SHELL_VERSION_FILE
fi
popd > /dev/null

View File

@ -11,9 +11,12 @@
},
"bugs": "https://github.com/kitematic/kitematic/issues",
"scripts": {
"start": "rsync ./index.html ./build/ && rsync ./fonts/* ./build/ && rsync ./images/* ./build && jsx --watch src/ build/ & wess -w -m -i ./styles/main.less -o ./build/main.css & wiper -w ./build/**/*.* & NODE_ENV=development ./cache/Atom.app/Contents/MacOS/Atom . && kill $(pgrep node)",
"preinstall": "./deps",
"test": "jsx src build/ && rsync ./images/* ./build && wess -m -i ./styles/main.less -o ./build/main.css & NODE_ENV=test ./cache/Atom.app/Contents/MacOS/Atom . --test",
"start": "rsync ./index.html ./build/ && rsync ./fonts/* ./build/ && rsync ./images/* ./build && jsx --watch src/ build/ & wess -w -m -i ./styles/main.less -o ./build/main.css & wiper -w ./build/**/*.* & npm run start:$(uname) && kill $(pgrep node)",
"start:Darwin": "NODE_ENV=development ./cache/darwin/Atom.app/Contents/MacOS/Atom .",
"start:Linux": "NODE_ENV=development ./cache/linux/atom .",
"test": "jsx --watch src build/ & rsync ./images/* ./build && wess -m -i ./styles/main.less -o ./build/main.css && npm run test:$(uname)",
"test:Darwin": "NODE_ENV=test ./cache/darwin/Atom.app/Contents/MacOS/Atom . --test",
"test:Linux": "NODE_ENV=test ./cache/darwin/atom .",
"release": "./release"
},
"licenses": [
@ -56,6 +59,7 @@
"devDependencies": {
"ecstatic": "^0.5.8",
"glob": "^4.0.6",
"jasmine-node": "^1.14.5",
"jasmine-reporters": "^1.0.1",
"jasmine-tagged": "^1.1.2",
"jasmine-terminal-reporter": "^0.9.1",

View File

@ -1,10 +1,16 @@
window.jasmineRequire = require('./jasmine-2.1.3/jasmine');
require('./jasmine-2.1.3/jasmine-html');
require('./jasmine-2.1.3/boot');
var consoleReporter = require('./jasmine-2.1.3/console');
var Reporter = require('jasmine-terminal-reporter');
var reporter = new Reporter();
jasmine.getEnv().addReporter(reporter);
jasmine.getEnv().addReporter(new consoleReporter.ConsoleReporter()({
showColors: true,
timer: new jasmine.Timer(),
print: function() {
console.log(arguments);
process.stdout.write.apply(process.stdout, arguments);
}
}));
var fs = require('fs');
var tests = fs.readdirSync('./specs').filter(function (f) {