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

fix: restore compatibility with jest 28 #1599

Merged
merged 3 commits into from
Aug 15, 2022

Conversation

dereekb
Copy link
Contributor

@dereekb dereekb commented Aug 12, 2022

Fixes the adaptors export. Current export has issues when running in a jest 28 testing environment due to the ESM resolution.

Example error:

...

    Details:

    /home/circleci/code/node_modules/angular-calendar/date-adapters/esm/date-fns/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { __assign } from "tslib";
                                                                                      ^^^^^^

    SyntaxError: Cannot use import statement outside a module
...

https://app.circleci.com/pipelines/github/dereekb/dbx-components/1530/workflows/fdecd446-eb34-4ba3-8f42-d4917aa8eb56/jobs/4210/parallel-runs/0/steps/0-110

This change allows Jest/CommonJS to import the date-adapters via require(). This change does not impact Angular builds that utilize ESM.

@dereekb dereekb force-pushed the fix/adaptors-export branch from 7b4b21d to 5f5bbb6 Compare August 12, 2022 22:06
Copy link
Owner

@mattlewis92 mattlewis92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!!

@mattlewis92 mattlewis92 changed the title build: fix exports for date adapters fix: restore compatibility with jest 28 Aug 15, 2022
@mattlewis92 mattlewis92 merged commit 3cb63e1 into mattlewis92:main Aug 15, 2022
@mattlewis92
Copy link
Owner

Released as 0.30.1, please let me know if that works for you! 🙌

@dereekb
Copy link
Contributor Author

dereekb commented Aug 15, 2022

Thank you!

@dereekb dereekb deleted the fix/adaptors-export branch August 15, 2022 19:57
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

Successfully merging this pull request may close these issues.

2 participants