Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ace TravisCI unit tests fail (yet pass on MacOS, Windows and Linux) #322

Closed
danielweck opened this issue May 8, 2020 · 3 comments
Closed

Comments

@danielweck
Copy link
Member

Latest Ace 1.2.0-beta.13:
#315

https://travis-ci.org/github/daisy/ace/jobs/684576632

TypeError: _fakeTimers(...).LegacyFakeTimers is not a constructor

danielweck added a commit that referenced this issue May 8, 2020
@danielweck
Copy link
Member Author

danielweck commented May 8, 2020

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};
}

@danielweck
Copy link
Member Author

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

@danielweck
Copy link
Member Author

danielweck commented May 8, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant