mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-20 13:36:20 +00:00
Updated to stryker v4
This commit is contained in:
@@ -82,7 +82,7 @@ describe('selectedServerReducer', () => {
|
||||
it('dispatches error when health endpoint fails', async () => {
|
||||
const id = uuid();
|
||||
const getState = createGetStateMock(id);
|
||||
const expectedSelectedServer: NonReachableServer = { ...selectedServer, serverNotReachable: true };
|
||||
const expectedSelectedServer = Mock.of<NonReachableServer>({ ...selectedServer, serverNotReachable: true });
|
||||
|
||||
apiClientMock.health.mockRejectedValue({});
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Mock } from 'ts-mockery';
|
||||
import { CsvJson } from 'csvjson';
|
||||
import ServersImporter from '../../../src/servers/services/ServersImporter';
|
||||
import { RegularServer } from '../../../src/servers/data';
|
||||
|
||||
describe('ServersImporter', () => {
|
||||
const servers: RegularServer[] = [ Mock.all<RegularServer>(), Mock.all<RegularServer>() ];
|
||||
const csvjsonMock = {
|
||||
toObject: jest.fn().mockReturnValue(servers),
|
||||
};
|
||||
const toObject = jest.fn().mockReturnValue(servers);
|
||||
const csvjsonMock = Mock.of<CsvJson>({ toObject });
|
||||
const readAsText = jest.fn();
|
||||
const fileReaderMock = Mock.of<FileReader>({
|
||||
readAsText,
|
||||
@@ -33,7 +33,7 @@ describe('ServersImporter', () => {
|
||||
await importer.importServersFromFile(Mock.of<File>({ type: 'text/csv' }));
|
||||
|
||||
expect(readAsText).toHaveBeenCalledTimes(1);
|
||||
expect(csvjsonMock.toObject).toHaveBeenCalledTimes(1);
|
||||
expect(toObject).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user