diff --git a/Gruntfile.js b/Gruntfile.js index 6981bb2d..250a884e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -228,6 +228,11 @@ module.exports = function(grunt) { dest: 'build/closure/closure_compiled_binary.js' } }, + karma: { + unit: { + configFile: 'karma.conf.js' + } + }, nodewebkit: { options: { build_dir: './dest/desktop/', // destination folder of releases. @@ -262,6 +267,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-replace'); grunt.loadNpmTasks('grunt-ghost'); grunt.loadNpmTasks('grunt-open'); + grunt.loadNpmTasks('grunt-karma'); grunt.loadNpmTasks('grunt-leading-indent'); grunt.loadNpmTasks('grunt-node-webkit-builder'); grunt.loadNpmTasks('grunt-contrib-copy'); @@ -269,8 +275,11 @@ module.exports = function(grunt) { // Validate grunt.registerTask('lint', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint']); + // karma/unit-tests task + grunt.registerTask('unit-test', ['karma']); + // Validate & Test - grunt.registerTask('test', ['lint', 'compile', 'express:test', 'ghost:default']); + grunt.registerTask('test', ['lint', 'compile', 'unit-test','express:test', 'ghost:default']); // Validate & Test (faster version) will NOT work on travis !! grunt.registerTask('precommit', ['lint', 'compile', 'express:test', 'ghost:local']); diff --git a/karma.conf.js b/karma.conf.js index 91d9f73b..1580b4b3 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -60,11 +60,11 @@ module.exports = function(config) { // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['Chrome'], + browsers: ['PhantomJS'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits - singleRun: false + singleRun: true }); }; diff --git a/misc/scripts/package-windows-executable.cmd b/misc/scripts/package-windows-executable.cmd index 5d37241c..f8fd6c4f 100644 --- a/misc/scripts/package-windows-executable.cmd +++ b/misc/scripts/package-windows-executable.cmd @@ -12,34 +12,14 @@ SETLOCAL set APP_BIN="%PISKEL_HOME%\dest\desktop\cache\win\0.9.2" set MISC_FOLDER=%PISKEL_HOME%\misc set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop\releases - set DEST_FOLDER=%RELEASES_FOLDER%\win + set DEST_FOLDER=%RELEASES_FOLDER%\piskel\win\piskel - ECHO "Building Piskel executable for Windows ..." - - ECHO "Creating release directory ..." - MKDIR "%DEST_FOLDER%" - ECHO "DONE" - - ECHO "Packaging executable ..." - COPY /b "%APP_BIN%\nw.exe"+"%RELEASES_FOLDER%\piskel\piskel.nw" "%DEST_FOLDER%\piskel-raw.exe" - ECHO "DONE" - - ECHO "COPYing dependencies ..." - COPY "%APP_BIN%\*.dll" "%DEST_FOLDER%\" - COPY "%APP_BIN%\nw.pak" "%DEST_FOLDER%\" - ECHO "DONE" ECHO "Updating Piskel icon -- Using Resource Hacker" - %RESOURCE_HACKER_PATH%\ResHacker -addoverwrite "%DEST_FOLDER%\piskel-raw.exe", "%DEST_FOLDER%\piskel-exploded.exe", "%MISC_FOLDER%\desktop\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033 - DEL "%DEST_FOLDER%\piskel-raw.exe" + %RESOURCE_HACKER_PATH%\ResHacker -addoverwrite "%DEST_FOLDER%\piskel.exe", "%DEST_FOLDER%\piskel-logo.exe", "%MISC_FOLDER%\desktop\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033 + DEL "%DEST_FOLDER%\piskel.exe" ECHO "DONE" - ECHO "Boxing application to single file -- Using Enigma Virtual Box" - %VBOX_PATH%\enigmavbconsole "%MISC_FOLDER%\desktop\package-piskel.evb" - DEL "%DEST_FOLDER%\*.dll" - DEL "%DEST_FOLDER%\nw.pak" - DEL "%DEST_FOLDER%\piskel-exploded.exe" - ECHO "DONE" PAUSE explorer "%DEST_FOLDER%\" diff --git a/package.json b/package.json index e5c39646..a24fa246 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "grunt-node-webkit-builder": "0.1.21", "grunt-open": "0.2.3", "grunt-replace": "0.7.8", + "grunt-karma": "~0.8.2", "karma": "0.12.17", "karma-chrome-launcher": "^0.1.4", "karma-jasmine": "^0.1.5",