mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
Fixed tests
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {createConfigFromSource} from '../../src/input/config_factory';
|
||||
import DOMHelper from '../../src/common/dom_helper';
|
||||
|
||||
function MyFileList(file) {
|
||||
Array.call(this);
|
||||
@@ -7,7 +8,7 @@ function MyFileList(file) {
|
||||
MyFileList.prototype = Object.create(Array.prototype);
|
||||
MyFileList.prototype.constructor = MyFileList;
|
||||
|
||||
const OriginalFileList = window.FileList;
|
||||
const OriginalFileList = DOMHelper.FileList;
|
||||
|
||||
function expectImageConfig(config) {
|
||||
expect(config.inputStream.type).to.equal("ImageStream");
|
||||
@@ -30,11 +31,11 @@ function expectLiveConfig(config) {
|
||||
|
||||
describe("createConfigFromSource", () => {
|
||||
beforeEach(function() {
|
||||
window.FileList = MyFileList;
|
||||
DOMHelper.setObject('FileList', MyFileList);
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
window.FileList = OriginalFileList;
|
||||
DOMHelper.setObject('FileList', OriginalFileList);
|
||||
});
|
||||
|
||||
it("should create an image config for an image-file", () => {
|
||||
|
||||
Reference in New Issue
Block a user