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

[testing] module first approach #52

Closed
LarsDenBakker opened this issue Nov 18, 2018 · 6 comments
Closed

[testing] module first approach #52

LarsDenBakker opened this issue Nov 18, 2018 · 6 comments

Comments

@LarsDenBakker
Copy link
Member

Currently our testing package relies on modifying globals. This makes tests non self contained and requires some magic to happen before test files are run, either in a parent index.html / index.js and/or requires test tool configuration.

My proposal is to go fully with modules, in your tests use: import chai from '@open-wc/testing which contains all the necessary plugins registered. The same goes for the automatic fixture cleanup, we could register this automatically when you create a fixture or also when you import chai.

@daKmoR
Copy link
Member

daKmoR commented Nov 18, 2018

so to not be dependent on webpack as a build tool... this means we should use a "native" es module version of chai.

So basically add it to https://github.com/bundled-es-modules right? and then use that one instead of the "official" chai

@LarsDenBakker
Copy link
Member Author

Yes if we want to stick to native es modules for everything we will need to do that. Alternatively we could check if express can be loaded with an import, and export from the window.

@daKmoR
Copy link
Member

daKmoR commented Nov 18, 2018

I would say the more "correct" solution would be "native" es modules for chai itself. using it via some express magic feels like a workaround.

We should do this for sinon then as well 💪

PS: just thinking using renovate auto merge + fully CD we should be able to get automatically new versions released (without any manual work)... uh that sounds like a good plan for bundled-es-modules

@LarsDenBakker
Copy link
Member Author

Sinon 7 ships native es modules :D wct is still on sinon v1 haha.

Are you able to make the es version of chai? Then ill work on the changes to the testing package

@daKmoR
Copy link
Member

daKmoR commented Nov 18, 2018

uuhh nice - native es version 👍

sounds good will make it right now :) published name will be @bundled-es-modules/chai I guess

@daKmoR
Copy link
Member

daKmoR commented Nov 18, 2018

solved with latest release

@daKmoR daKmoR closed this as completed Nov 18, 2018
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

2 participants