Testing AWS UI components with Jest

Charles Stover
3 min readFeb 9, 2021

Developers who have recently installed AWS’s new UI component library may quickly run into trouble with their unit tests. AWS UI is written in ECMAScript, and Jest cannot import it by default.

Jest encountered an unexpected token.

The full error will look something like this:

Test suite failed to runJest encountered an unexpected tokenThis usually means that…

--

--