Fixing jest tests, adding integration tests

This commit is contained in:
Jeffrey Morgan
2015-05-26 18:49:23 -07:00
parent 5af7c74381
commit a3fb14462a
8 changed files with 68 additions and 22 deletions

View File

@@ -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', () => {
});
});
});

View File

@@ -0,0 +1,9 @@
jest.autoMockOff();
describe('RegHubUtil Integration Tests', () => {
describe('repos', () => {
it('returns set of repos', () => {
});
});
});

View File

@@ -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 () {

View File

@@ -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(() => {

View File

@@ -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 () {

View File

@@ -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 () {

19
jest-integration.json Normal file
View File

@@ -0,0 +1,19 @@
{
"testDirectoryName": "__integration__",
"scriptPreprocessor": "<rootDir>/util/preprocessor.js",
"setupEnvScriptFile": "<rootDir>/util/testenv.js",
"setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js",
"unmockedModulePathPatterns": [
"alt",
"stream",
"tty",
"net",
"crypto",
"babel",
"<rootDir>/node_modules/.*JSONStream",
"<rootDir>/node_modules/object-assign",
"<rootDir>/node_modules/underscore",
"<rootDir>/node_modules/bluebird",
"<rootDir>/node_modules/source-map-support"
]
}

View File

@@ -13,6 +13,7 @@
"scripts": {
"start": "gulp",
"test": "jest",
"integration": "jest -c jest-integration.json",
"release": "gulp release",
"release:beta": "gulp release --beta",
"lint": "jsxhint src",
@@ -28,12 +29,6 @@
"scriptPreprocessor": "<rootDir>/util/preprocessor.js",
"setupEnvScriptFile": "<rootDir>/util/testenv.js",
"setupTestFrameworkScriptFile": "<rootDir>/util/prepare.js",
"collectCoverage": true,
"testDirectoryName": "src",
"testPathIgnorePatterns": [
"/node_modules/",
"^((?!-test).)*$"
],
"unmockedModulePathPatterns": [
"alt",
"stream",
@@ -66,8 +61,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 +97,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",