diff --git a/.travis.yml b/.travis.yml index a9888c7891..78c160f79c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,3 @@ cache: directories: - resources - node_modules - -after_success: - - which ./node_modules/coveralls/bin/coveralls.js && cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js diff --git a/__integration__/HubUtil-integration.js b/__integration__/HubUtil-integration.js new file mode 100644 index 0000000000..d6638c355d --- /dev/null +++ b/__integration__/HubUtil-integration.js @@ -0,0 +1,23 @@ +jest.autoMockOff(); + +describe('HubUtil Integration Tests', () => { + describe('token refresh', () => { + it('re-auths if the token has expired', () => { + expect(true).toBe(true); + }); + }); + + describe('signup', () => { + it('returns a 204 and sets localstorage data', () => { + }); + }); + + describe('login', () => { + it('Returns a 401 with account not active string if not active', () => { + + }); + it('Returns a 401 if the password is wrong', () => { + + }); + }); +}); diff --git a/__integration__/RegHubUtil-integration.js b/__integration__/RegHubUtil-integration.js new file mode 100644 index 0000000000..782a499093 --- /dev/null +++ b/__integration__/RegHubUtil-integration.js @@ -0,0 +1,9 @@ +jest.autoMockOff(); + +describe('RegHubUtil Integration Tests', () => { + describe('repos', () => { + it('returns set of repos', () => { + + }); + }); +}); diff --git a/src/stores/SetupStore-test.js b/__tests__/SetupStore-test.js similarity index 91% rename from src/stores/SetupStore-test.js rename to __tests__/SetupStore-test.js index 5613d44aa5..3da5045882 100644 --- a/src/stores/SetupStore-test.js +++ b/__tests__/SetupStore-test.js @@ -1,9 +1,9 @@ -jest.dontMock('./SetupStore'); -var setupStore = require('./SetupStore'); -var virtualBox = require('../utils/VirtualBoxUtil'); -var util = require('../utils/Util'); -var machine = require('../utils/DockerMachineUtil'); -var setupUtil = require('../utils/SetupUtil'); +jest.dontMock('../src/stores/SetupStore'); +var setupStore = require('../src/stores/SetupStore'); +var virtualBox = require('../src/utils/VirtualBoxUtil'); +var util = require('../src/utils/Util'); +var machine = require('../src/utils/DockerMachineUtil'); +var setupUtil = require('../src/utils/SetupUtil'); describe('SetupStore', function () { describe('download step', function () { diff --git a/src/utils/URLUtil-test.js b/__tests__/URLUtil-test.js similarity index 95% rename from src/utils/URLUtil-test.js rename to __tests__/URLUtil-test.js index cfa137770d..2c1212523a 100644 --- a/src/utils/URLUtil-test.js +++ b/__tests__/URLUtil-test.js @@ -1,7 +1,7 @@ -jest.dontMock('./URLUtil'); +jest.dontMock('../src/utils/URLUtil'); jest.dontMock('parseUri'); -var urlUtil = require('./URLUtil'); -var util = require('./Util'); +var urlUtil = require('../src/utils/URLUtil'); +var util = require('../src/utils/Util'); describe('URLUtil', function () { beforeEach(() => { diff --git a/src/utils/Util-test.js b/__tests__/Util-test.js similarity index 98% rename from src/utils/Util-test.js rename to __tests__/Util-test.js index 471b1088c5..985d05bdc8 100644 --- a/src/utils/Util-test.js +++ b/__tests__/Util-test.js @@ -1,5 +1,5 @@ -jest.dontMock('./Util'); -var util = require('./Util'); +jest.dontMock('../src/utils/Util'); +var util = require('../src/utils/Util'); describe('Util', function () { describe('when removing sensitive data', function () { diff --git a/src/utils/VirtualBoxUtil-test.js b/__tests__/VirtualBoxUtil-test.js similarity index 77% rename from src/utils/VirtualBoxUtil-test.js rename to __tests__/VirtualBoxUtil-test.js index 7af88edd99..3bf9a4427b 100644 --- a/src/utils/VirtualBoxUtil-test.js +++ b/__tests__/VirtualBoxUtil-test.js @@ -1,6 +1,6 @@ -jest.dontMock('./VirtualBoxUtil'); -var virtualBox = require('./VirtualBoxUtil'); -var util = require('./Util'); +jest.dontMock('../src/utils/VirtualBoxUtil'); +var virtualBox = require('../src/utils/VirtualBoxUtil'); +var util = require('../src/utils/Util'); describe('VirtualBox', function () { it('returns the right command', function () { diff --git a/jest-integration.json b/jest-integration.json new file mode 100644 index 0000000000..1405f9045e --- /dev/null +++ b/jest-integration.json @@ -0,0 +1,10 @@ +{ + "testDirectoryName": "__integration__", + "scriptPreprocessor": "/util/preprocessor.js", + "setupEnvScriptFile": "/util/testenv.js", + "setupTestFrameworkScriptFile": "/util/prepare.js", + "unmockedModulePathPatterns": [ + "babel", + "/node_modules/source-map-support" + ] +} diff --git a/jest-unit.json b/jest-unit.json new file mode 100644 index 0000000000..0981c13ebf --- /dev/null +++ b/jest-unit.json @@ -0,0 +1,18 @@ +{ + "scriptPreprocessor": "/util/preprocessor.js", + "setupEnvScriptFile": "/util/testenv.js", + "setupTestFrameworkScriptFile": "/util/prepare.js", + "unmockedModulePathPatterns": [ + "alt", + "stream", + "tty", + "net", + "crypto", + "babel", + "/node_modules/.*JSONStream", + "/node_modules/object-assign", + "/node_modules/underscore", + "/node_modules/bluebird", + "/node_modules/source-map-support" + ] +} diff --git a/package.json b/package.json index 88842835bb..25ce4dd1d3 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "bugs": "https://github.com/kitematic/kitematic/issues", "scripts": { "start": "gulp", - "test": "jest", + "test": "jest -c jest-unit.json", + "integration": "jest -c jest-integration.json", "release": "gulp release", "release:beta": "gulp release --beta", "lint": "jsxhint src", @@ -24,30 +25,6 @@ "url": "http://www.apache.org/licenses/LICENSE-2.0.html" } ], - "jest": { - "scriptPreprocessor": "/util/preprocessor.js", - "setupEnvScriptFile": "/util/testenv.js", - "setupTestFrameworkScriptFile": "/util/prepare.js", - "collectCoverage": true, - "testDirectoryName": "src", - "testPathIgnorePatterns": [ - "/node_modules/", - "^((?!-test).)*$" - ], - "unmockedModulePathPatterns": [ - "alt", - "stream", - "tty", - "net", - "crypto", - "babel", - "/node_modules/.*JSONStream", - "/node_modules/object-assign", - "/node_modules/underscore", - "/node_modules/bluebird", - "/node_modules/source-map-support" - ] - }, "docker-version": "1.6.2", "docker-machine-version": "0.2.0", "electron-version": "0.26.0", @@ -66,8 +43,8 @@ "classnames": "^1.2.0", "coveralls": "^2.11.2", "deep-extend": "^0.4.0", - "dockerode": "^2.1.4", "exec": "0.2.0", + "dockerode": "^2.1.4", "install": "^0.1.8", "jquery": "^2.1.3", "mixpanel": "0.2.0", @@ -102,7 +79,7 @@ "gulp-shell": "^0.4.1", "gulp-sourcemaps": "^1.5.2", "gulp-util": "^3.0.4", - "jest-cli": "kitematic/jest", + "jest-cli": "^0.4.5", "jsxhint": "^0.14.0", "minimist": "^1.1.1", "react-tools": "^0.13.1",