Chrome will let you create a new file:
var f = new File([""], "filename", { type: 'text/html' });
However IE11 (and other browsers?) will not.
Here's is my (poor?) fake File:
var blob = new Blob([""], { type: 'text/html' });
blob["lastModifiedDate"] = "";
blob["name"] = "filename";
var fakeF = blob;
You can fill in the values as you see fit. You can fill the blob with whatever you need. (See the other answer for how to use an image).
I've tested this in IE11, Chrome and Firefox. So far I seems to work, at least for my unit testing purposes.
Bonus:
Here it is in typescript:
let blob = new Blob([""], { type: 'text/html' });
blob["lastModifiedDate"] = "";
blob["name"] = "filename";
let fakeF = <File>blob;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…