mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
Move testing to Jest
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user