-
Notifications
You must be signed in to change notification settings - Fork 109
Closed
Labels
Description
ClockDate class overwrite prototype of instance.
In my real project it happens when I use datepicker library (@eonasdan/tempus-dominus).
- FakeTimers version : 9.1.2
- Environment : Opera 89.0.4447.64, Windows 10
- Example URL : repository
- Other libraries you are using: -
What did you expect to happen?
I expected to receive instance of DateTime with it's methods
What actually happens
Prototype of child instance is not equals to DateTime class, but equals to fake date class
How to reproduce
I'd created a repository with reproducing this problem
i. You can clone and run project
ii. Or you can create project with @sinonjs/fake-timers and run the code below by yourself
var FakeTimers = require("@sinonjs/fake-timers");
FakeTimers.install();
class DateTime extends Date {
constructor() {
super();
this.bar = 'bar';
}
foo() {
console.log('Lorem inpsum');
}
}
var dateTime = new DateTime();
dateTime.foo();