diff --git a/.gitignore b/.gitignore index 7b9e66caf1..ca23db9e8a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ build dist node_modules +coverage npm-debug.log # Signing Identity diff --git a/.jshintrc b/.jshintrc index 9240a3ae9f..daeaf45072 100644 --- a/.jshintrc +++ b/.jshintrc @@ -27,5 +27,5 @@ "jest": true, "pit": true }, - "predef": [ "-Promise" ] + "predef": [ "Promise" ] } diff --git a/package.json b/package.json index bbb611d8c7..057aac3a84 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "bugs": "https://github.com/kitematic/kitematic/issues", "scripts": { "start": "gulp", - "test": "jest", + "test": "jest --coverage", "release": "gulp release", "release:beta": "gulp release --beta", "preinstall": "./util/deps", @@ -28,16 +28,21 @@ "jest": { "scriptPreprocessor": "/util/preprocessor.js", "setupEnvScriptFile": "/util/testenv.js", + "collectCoverage": true, + "testDirectoryName": "src", + "testPathIgnorePatterns": [ + "/node_modules/", + "^((?!-test).)*$" + ], "unmockedModulePathPatterns": [ + "stream", "tty", "net", "crypto", - "stream", + "/node_modules/.*JSONStream", "/node_modules/object-assign", "/node_modules/underscore", - "/node_modules/react", - "/node_modules/bluebird", - "/node_modules/babel" + "/node_modules/bluebird" ] }, "docker-version": "1.5.0", @@ -51,7 +56,8 @@ "async": "^0.9.0", "bluebird": "^2.9.12", "bugsnag-js": "^2.4.7", - "dockerode": "^2.0.7", + "coveralls": "^2.11.2", + "dockerode": "^2.1.1", "exec": "0.2.0", "jquery": "^2.1.3", "minimist": "^1.1.0", @@ -76,6 +82,7 @@ "gulp-cssmin": "^0.1.6", "gulp-download-atom-shell": "0.0.4", "gulp-if": "^1.2.5", + "gulp-insert": "^0.4.0", "gulp-less": "^3.0.1", "gulp-livereload": "^3.8.0", "gulp-plumber": "^0.6.6", @@ -83,7 +90,7 @@ "gulp-shell": "^0.3.0", "gulp-sourcemaps": "^1.5.0", "gulp-util": "^3.0.4", - "jest-cli": "^0.4.0", + "jest-cli": "kitematic/jest", "jsxhint": "^0.12.1", "react-tools": "^0.12.2", "run-sequence": "^1.0.2" diff --git a/__tests__/SetupStore-test.js b/src/SetupStore-test.js similarity index 92% rename from __tests__/SetupStore-test.js rename to src/SetupStore-test.js index 1410a883b0..42add6fd37 100644 --- a/__tests__/SetupStore-test.js +++ b/src/SetupStore-test.js @@ -1,10 +1,9 @@ -jest.dontMock('../src/SetupStore'); -var setupStore = require('../src/SetupStore'); -var virtualBox = require('../src/VirtualBox'); -var util = require('../src/Util'); -var machine = require('../src/DockerMachine'); -var setupUtil = require('../src/SetupUtil'); -var Promise = require('bluebird'); +jest.dontMock('./SetupStore'); +var setupStore = require('./SetupStore'); +var virtualBox = require('./VirtualBox'); +var util = require('./Util'); +var machine = require('./DockerMachine'); +var setupUtil = require('./SetupUtil'); describe('SetupStore', function () { describe('download step', function () { diff --git a/__tests__/Virtualbox-test.js b/src/Virtualbox-test.js similarity index 76% rename from __tests__/Virtualbox-test.js rename to src/Virtualbox-test.js index 1a8efa7aab..567210a08a 100644 --- a/__tests__/Virtualbox-test.js +++ b/src/Virtualbox-test.js @@ -1,7 +1,6 @@ -jest.dontMock('../src/VirtualBox'); -var virtualBox = require('../src/VirtualBox'); -var util = require('../src/Util'); -var Promise = require('bluebird'); +jest.dontMock('./VirtualBox'); +var virtualBox = require('./VirtualBox'); +var util = require('./Util'); describe('VirtualBox', function () { it('returns the right command', function () {