Closed danielweck closed 4 years ago
https://travis-ci.org/github/daisy/ace/jobs/684601865
Investigation shows that the LegacyFakeTimers
class is in fact undefined
https://github.com/facebook/jest/blob/master/packages/jest-environment-node/src/index.ts https://unpkg.com/browse/jest-environment-node@26.0.1/build/index.js
this.fakeTimers = new (_fakeTimers().LegacyFakeTimers)({
config,
global,
moduleMocker: this.moduleMocker,
timerConfig
});
I note the typical TypeScript transpiled output for default
exports and __esModule
, but this works just fine in other Linux computers, so I fail to see what is specific to Travis here (same Node versions):
https://github.com/facebook/jest/blob/master/packages/jest-fake-timers/src/legacyFakeTimers.ts https://unpkg.com/browse/@jest/fake-timers@26.0.1/build/legacyFakeTimers.js
Object.defineProperty(exports, '__esModule', {
https://github.com/facebook/jest/blob/master/packages/jest-fake-timers/src/index.ts https://unpkg.com/browse/@jest/fake-timers@26.0.1/build/index.js
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
Object.defineProperty(exports, 'LegacyFakeTimers', {
enumerable: true,
get: function () {
return _legacyFakeTimers.default;
}
});
var _legacyFakeTimers = _interopRequireDefault(require('./legacyFakeTimers'));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
Note that other modules work, such as this.moduleMocker = new (_jestMock().ModuleMocker)(global);
:
https://unpkg.com/browse/jest-environment-node@26.0.1/build/index.js
=>
https://unpkg.com/browse/jest-mock@26.0.1/build/index.js
...so I am guessing the problem stems from the level of indirection: https://unpkg.com/browse/@jest/fake-timers@26.0.1/build/index.js
Latest Ace
1.2.0-beta.13
: https://github.com/daisy/ace/pull/315https://travis-ci.org/github/daisy/ace/jobs/684576632
TypeError: _fakeTimers(...).LegacyFakeTimers is not a constructor