I18n

Internalisation

Watch User Created Playlist (2)

This playlist is user created.

pro-course-rss-logo

PRO RSS Feed

Write tests for react-intl output using enzyme and Jest

P

Install and Configure the Entry Point of react-intl

react tutorial about Write tests for react-intl output using enzyme and Jest

Write tests for react-intl output using enzyme and Jest

7:30 react PRO

In this lesson, we’ll look at writing test assertions for react-intl output. We'll add the necessary dependencies, then we’ll use Jest snapshots to get assertions written quickly. Then, we’ll use enzyme API methods to traverse the DOM and write assertions about specific pieces of react-intl data.

Note: This lesson uses a modified version of an "intl-enzyme" helper utility from the react-intl documentation. You can find the modified file here.

react tutorial about Install and Configure the Entry Point of react-intl

Install and Configure the Entry Point of react-intl

4:21 react

We’ll install react-intl, then add it to the mounting point of our React app.

Then, we’ll use react-intl helpers to load locales in our app, including English, Spanish and French and choose which locale data to load based on the user's browser language.

We’ll also set up and include messages files for each language, which hold all of the translated strings for our app.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?