tvkitchen / countertop

The entry point for developers who want to set up a TV Kitchen.
https://tv.kitchen
GNU Lesser General Public License v3.0
6 stars 2 forks source link

Configure Jest to support absolute imports #36

Closed reefdog closed 4 years ago

reefdog commented 4 years ago

Description

We use module-alias to let us absolutely import modules from defined roots. However, Jest doesn’t pick up these defined roots automatically; instead, we need to replicate them in our Jest configuration.

This PR adds that configuration. Note that Jest uses regex and suggests you include beginning/end anchors for explicitness, so we do.

Due Diligence Checklist

Steps to Test

  1. yarn test

Deploy Notes

None.

Related Issues

Resolves #35

reefdog commented 4 years ago

@slifty Okay! I implemented the suggestion to create a central shared tooling utility for extracting package.json's module-alias configuration and transforming it to a tool-specific configuration, then using that for ESLint and Jest. Let me know what you think…

reefdog commented 4 years ago

Oops, just asked for a re-review, but "no need for re-review". Going!