Skip to content

Commit fa32a97

Browse files
Update limitation page (#1832)
Co-authored-by: Liam Ma <[email protected]>
1 parent 9fd3818 commit fa32a97

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

website/packages/docs/src/pages/limitations.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,25 @@ The simplest workaround is migrating to a ternary, eg. `props.isSelected ? '0 0
7777

7878
For more details, refer to the [Github Issue](https://github.com/atlassian-labs/compiled/issues/1794).
7979

80+
## Jest Coverage and Compiled Errors
81+
82+
When running Jest in coverage collection mode (e.g., using the command jest --coverage), you might encounter an error like the following:
83+
84+
```
85+
SyntaxError:
86+
CSS Map must be declared at the top-most scope of the module.
87+
Check out our documentation for cssMap examples: https://compiledcssinjs.com/docs/api-cssmap
88+
89+
> 41 | const styles = cssMap({
90+
| ^
91+
```
92+
93+
This issue typically does not occur when running the tests in non-coverage mode. By default, Jest uses Istanbul to instrument the code, which transforms it before @compiled/babel-plugin is applied. As a result, the plugin fails to correctly interpret certain syntax, causing the error.
94+
95+
To resolve this issue, you can switch Jest's coverage provider to v8 instead of the default Istanbul.
96+
97+
For more details about configuring Jest's coverage settings, refer to the official Jest documentation: [Jest Configuration - collectCoverage](https://jestjs.io/docs/configuration#collectcoverage-boolean).
98+
8099
## Unsupported features
81100

82101
Below is a non-exhaustive list of features that Compiled does not support. Some are features we would like to add to Compiled at some point in the future, while others are features that we don't plan to implement.

0 commit comments

Comments
 (0)