SUI-Components / sui

Monorepo for SUI (Simple User Interface) packages.
169 stars 33 forks source link

feat(packages/sui-studio): Add jest compatibility with test path on studio-dev #1767

Closed jelowin closed 3 months ago

jelowin commented 3 months ago

Description

At Fotocasa Portal, we are integrating Jest into our tests. One of the problems we encountered was that we couldn't start the demos with studio-dev because it was searching for the path "test/index.test", leading to an error. Screenshot 2024-06-06 at 10 14 29

This PR solves the problem by detecting if the component has a Jest test and then changing the test alias to later import the correct path.

Related Issue

Example

Demo on component with Jest test

Screenshot 2024-06-07 at 13 46 05