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

[5.x.x] choose a test harness setup #1504

Closed
43081j opened this issue Feb 15, 2023 · 5 comments
Closed

[5.x.x] choose a test harness setup #1504

43081j opened this issue Feb 15, 2023 · 5 comments

Comments

@43081j
Copy link
Contributor

43081j commented Feb 15, 2023

Once we move away from just shipping a bundle, we need something capable of resolving bare specifiers in tests.

karma by itself can't do that, so we would have a few options:

Option 1

Continue shipping a bundle.

If we do this, we can use karma still and consumers can use our bundle in a browser without themselves needing to deal with bare specifiers.

Option 2

Use something like karma-esm.

In theory, karma would then understand the bare specifiers and could run tests against the source rather than a bundle.

Consumers would need their own solution to the same problem (usually a bundler, or an import map).

Option 3

Move to another test runner like web-test-runner or, once they have a browser runner, vitest.

Importantly, whatever test runner we choose should not use jsdom. it should launch a real browser.

Consumers would need their own solution to bare specifiers, just like in option 2.

@keithamus
Copy link
Member

My vote is for us to move to web-test-runner, it's a great test runner and provides a minimal wrapper which allows us to test very close to "the metal" in browsers. I also think it would be useful to test twice - once with esm and once with the chai.js bundle.

@43081j
Copy link
Contributor Author

43081j commented Feb 15, 2023

i agree

and yes, if we intend on keeping the bundle even once we move to typescript, we'd have two test runs.

its possible one day you could drop the bundle entirely, but it does mean the consumer would have to handle the bare specifiers (via a bundler or import maps).

@keithamus
Copy link
Member

its possible one day you could drop the bundle entirely, but it does mean the consumer would have to handle the bare specifiers (via a bundler or import maps).

I won't say never 😉 but that does indeed seem unlikely for the foreseeable. By which I mean to say it won't harm us to invest in ensuring the bundled version is robust while import map usage is very low.

@jonkoops
Copy link

jonkoops commented May 6, 2023

Just to add to this discussion, Karma is now officially deprecated making option number two less appealing.

@koddsson
Copy link
Member

We moved to Web Test Runner in #1546!

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

No branches or pull requests

4 participants