A Karma shim for the
Intl for internationalization
npm install intl-shim --save-dev
karma.conf.js file, add
intl-shim to the
frameworks in your
You may need to also require it in your
Now when running
karma, you should not get an error that
Intl cannot be found.
IssuesThis shim simply attaches the
Intl library to the window so it's available for testing.
If you have issues, it's most likely an issue with
anyearnshaw/Intl.js, issues for the Intl project can be reported here.
ContributingPlease create a new issue if you find that you have an issue unrelated to
Intl under intl-shim.
Please submit a PR if you have made a modification. PRs will be reviewed within a 72 hour week day period of the initial PR.
Why is it webpacked?This project is built with webpack because the
shim.js is injected into the browser, which we all know doesn't have a "require" and this is an easy way to do that.