intl-shim

Provides a shim for Intl for PhantomJS

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
intl-shim
000.0.27 years ago7 years agoMinified + gzip package size for intl-shim in KB

Readme

intl-shim
A Karma shim for the Intl for internationalization

Installation

npm install intl-shim --save-dev

Usage

In your karma.conf.js file, add intl-shim to the frameworks in your config.set:
config.set({
  frameworks: ["intl-shim"],

You may need to also require it in your plugins array:
plugins: [
  require("intl-shim")
  ]

Now when running karma, you should not get an error that Intl cannot be found.

Issues

This 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.

Contributing

Please 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.