Move testing to Jest

This commit is contained in:
David Kaltschmidt
2015-10-26 14:22:41 +00:00
parent 15371a2bba
commit cacc2e1bc3
4 changed files with 38 additions and 19 deletions

View File

@@ -1,3 +1,7 @@
jest.dontMock('../node-details.js');
jest.dontMock('../../mixins/node-color-mixin');
jest.dontMock('../../utils/title-utils');
describe('NodeDetails', () => {
let NodeDetails;
let nodes;
@@ -28,4 +32,4 @@ describe('NodeDetails', () => {
expect(title.getDOMNode().textContent).toBe('Node 1');
});
});
});

View File

@@ -1,7 +1,11 @@
jest.dontMock('../../constants/action-types');
jest.dontMock('../app-store');
// Appstore test suite using Jasmine matchers
describe('AppStore', function() {
const ActionTypes = require('../../constants/action-types');
let AppDispatcher;
let AppStore;
let registeredCallback;
@@ -121,10 +125,9 @@ describe('AppStore', function() {
};
beforeEach(function() {
// clear AppStore singleton
delete require.cache[require.resolve('../app-store')];
AppDispatcher = require('../../dispatcher/app-dispatcher');
AppStore = require('../app-store');
registeredCallback = AppStore.registeredCallback;
registeredCallback = AppDispatcher.register.mock.calls[0][0];
});
// topology tests
@@ -309,4 +312,4 @@ describe('AppStore', function() {
expect(AppStore.getAdjacentNodes().size).toEqual(0);
});
});
});