Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(integration-karma): fix sourcemaps #3875

Merged
merged 6 commits into from
Nov 21, 2023

Conversation

nolanlawson
Copy link
Contributor

Details

This fixes sourcemaps in the Karma tests. I confirmed that you can actually set breakpoints in engine-dom using karma start, and that the Istanbul coverage HTML reports actually work now:

Screenshot 2023-11-17 at 3 39 45 PM

Does this pull request introduce a breaking change?

  • ✅ No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • ✅ No, it does not introduce an observable change.

@nolanlawson nolanlawson requested a review from a team as a code owner November 17, 2023 23:41
const { rollup } = require('rollup');
const replace = require('@rollup/plugin-replace');
const MagicString = require('magic-string');
const { init, parse } = require('es-module-lexer');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched from using Rollup to using magic-string and es-module-lexer to transform ESM into IIFE.

This new method should be a lot faster, since we really don't need all of Rollup just to transform our framework files (e.g. engine-dom/dist/index.js). These files don't have any imports, and just need some light editing to replace some strings and convert ESM to IIFE.

uses: actions/upload-artifact@v3
with:
name: coverage-report-combined
path: ./packages/@lwc/integration-karma/coverage/combined
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might as well upload the combined coverage files, especially now that the HTML actually works.

@nolanlawson
Copy link
Contributor Author

Added the summary data to the GitHub step action results:

Screenshot 2023-11-20 at 2 15 44 PM

@nolanlawson nolanlawson merged commit 6e75634 into master Nov 21, 2023
9 checks passed
@nolanlawson nolanlawson deleted the nolan/fix-karma-sourcemaps-2 branch November 21, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants