typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
109 stars 51 forks source link

Swap in Mocha for Jest in the Code extension tests #578

Closed dfreeman closed 1 year ago

dfreeman commented 1 year ago

We moved from Jest to Vitest for most of the monorepo back in https://github.com/typed-ember/glint/pull/376, but couldn't use Vitest for the extension test suite, as Code's test harness requires tests to run in-band to provide appropriate access to the editor APIs.

Jest does support our needs there with its --runInBand flag, but only barely—we've had occasional flakiness as Code updates have rolled out, and recently CI has begun consistently failing on the extension test suite for the past week or so. This PR finally moves us over to Mocha for the extension suite, which is what vscode-test recommends, as its harness is very straightforward to invoke in-process. We use the expect package for assertions, which has a compatible form factor and semantics with the expectations in Vitest and Jest (it is the underlying library Jest uses).