import { DataFileServiceImpl } from './datafile.service.impl'; import { Mock } from 'ts-mocks'; describe("DataFileServiceImpl", () => { var dataFileServiceImpl: DataFileServiceImpl; var fileReaderMock: Mock; var fileReader: FileReader; beforeEach(() => { fileReaderMock = new Mock(); fileReader = fileReaderMock.Object; dataFileServiceImpl = new DataFileServiceImpl(() => fileReader); }); describe("blobToString", () => { beforeEach(() => { fileReaderMock.setup(mock => mock.readAsText).is((blob: Blob) => { fileReaderMock.Object.onload({target: {result: blob.toString()}}); }); }); }); describe("arrayToString", () => { beforeEach(() => { fileReaderMock.setup(mock => mock.readAsArrayBuffer).is((blob: Blob) => { fileReaderMock.Object.onload({target: {result: blob.toString()}}); }); }); }); describe("readDataArrayAsPossibleArchive", () => { }); describe("downloadDataFileAsArrayBuffer", () => { }); });