Skip to content

feat: Babel Plugin - Mock css imports#1607

Merged
bmingles merged 4 commits intodeephaven:mainfrom
bmingles:1606-mock-css-imports
Nov 1, 2023
Merged

feat: Babel Plugin - Mock css imports#1607
bmingles merged 4 commits intodeephaven:mainfrom
bmingles:1606-mock-css-imports

Conversation

@bmingles
Copy link
Copy Markdown
Contributor

@bmingles bmingles commented Oct 31, 2023

Created a Babel transform plugin mockCssImportPlugin that transforms certain css imports into const expressions.

  • Replaces import of .module.css / .module.scss - with a const object literal containing a key / value of the module name
  • Replaces css imports of ?inline and ?raw with a const string literal matching the import path

The new plugin is configured as a plugin for babel-jest

resolves #1606

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a260842) 46.68% compared to head (9b6bcd8) 46.68%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1607      +/-   ##
==========================================
- Coverage   46.68%   46.68%   -0.01%     
==========================================
  Files         583      583              
  Lines       36267    36267              
  Branches     9074     9074              
==========================================
- Hits        16933    16930       -3     
- Misses      19282    19285       +3     
  Partials       52       52              
Flag Coverage Δ
unit 46.68% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmingles bmingles marked this pull request as ready for review October 31, 2023 15:14
@bmingles bmingles requested a review from mofojed October 31, 2023 15:14
@bmingles bmingles merged commit 787c542 into deephaven:main Nov 1, 2023
@bmingles bmingles deleted the 1606-mock-css-imports branch November 1, 2023 13:40
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Babel Plugin - Mock css imports

2 participants