Use class keyword in tests
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import {inherits} from '../../../../src/ol/index.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
import Event from '../../../../src/ol/events/Event.js';
|
||||
import EventTarget from '../../../../src/ol/events/EventTarget.js';
|
||||
@@ -94,14 +93,16 @@ where('FileReader').describe('ol.interaction.DragAndDrop', function() {
|
||||
beforeEach(function() {
|
||||
OrigFileReader = FileReader;
|
||||
|
||||
FileReader = function() {
|
||||
EventTarget.apply(this, arguments);
|
||||
this.readAsText = function(file) {
|
||||
class MockFileReader extends EventTarget {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
}
|
||||
readAsText(file) {
|
||||
this.result = file;
|
||||
this.dispatchEvent('load');
|
||||
};
|
||||
};
|
||||
inherits(FileReader, EventTarget);
|
||||
}
|
||||
}
|
||||
FileReader = MockFileReader;
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
|
||||
Reference in New Issue
Block a user