UNPKG

only-changed-jest-watch-plugin

Version:

Jest watch plugin for running either only the modified test (for TDD), or tests of dependant modules

13 lines (12 loc) 435 B
var DateProto = Date.prototype; var INVALID_DATE = 'Invalid Date'; var TO_STRING = 'toString'; var $toString = DateProto[TO_STRING]; var getTime = DateProto.getTime; if (new Date(NaN) + '' != INVALID_DATE) { require('./_redefine')(DateProto, TO_STRING, function toString() { var value = getTime.call(this); // eslint-disable-next-line no-self-compare return value === value ? $toString.call(this) : INVALID_DATE; }); }