MetaMask / core

This monorepo is a collection of packages used across multiple MetaMask clients
MIT License
287 stars 183 forks source link

Add smoke tests for CommonJS and ESM builds for each package #4386

Open mcmire opened 4 months ago

mcmire commented 4 months ago

Recently, the extension team has encountered issues with dependencies in core packages which ship with a default export. This causes the ESM and CJS builds to act differently, leading to an extremely frustrating experience.

Currently, we run tests for each package against a just-in-time, in-memory compiled version of that package, using the TypeScript configuration defined in this repo (thanks to ts-jest). We also have a way of statically analyzing package.json via the "Are the Types Wrong?" tool, and running this would give us some information on better practices we ought to follow when it comes to dual builds.

However, we have no idea whether these builds actually work in various scenarios. What we are missing is a way to run tests against different versions of the compiled JavaScript, simulating various kinds of projects.

Acceptance Criteria

desi commented 3 months ago