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 #40

Open
adam-lynch opened this issue May 31, 2014 · 6 comments
Open

Testing #40

adam-lynch opened this issue May 31, 2014 · 6 comments

Comments

@adam-lynch
Copy link

The Grunt example linked in the readme isn't very clear for me. I can only assume that if it wasn't properly UMD, then loads of the underlying tests would fail, which isn't ideal really.

It would be great if there were solid tests (in this / a separate project) for testing if everything is exported correctly, etc. Having tests properly documented, maintained and used would only increase confidence. Then there could be build system specific plugins / projects which just wrap / use these tests (perfect for CI).

What do you think? I'd love to contribute but I wouldn't be 100% sure what exactly sure be tested and what all the edge cases are.

@adam-lynch
Copy link
Author

cc @phated, @alexlawrence, @ForbesLindesay (authors of some UMD wrappers)

@alexlawrence
Copy link

cc @bebraw as I will not be maintaining grunt-umd anymore

@bebraw
Copy link

bebraw commented Jun 3, 2014

+1 Having tests available would be just great.

Now the big question is how to write those. Do you run them against real browsers, check AST, mock an environment and test against that or what?

@adam-lynch
Copy link
Author

@bebraw I guess we could mock an environment, I'm not sure really.

I'm thinking the AST route wouldn't be best. We shouldn't care how the code is layed out (e.g. if it's if(window) if(window.define) or window['def' + 'ine'] ? ... : ...), but that it does what it should. Then anyone can quickly come up with a new way of handling UMD / a completely new pattern. The problem with some of the existing tests out there are they check that code looks like an explicit pattern.

@szepeviktor
Copy link

@bebraw
Copy link

bebraw commented Feb 24, 2015

@adam-lynch I have some preliminary Saucelabs tests at libumd. I am certain the tests can be improved a lot but even this is better than nothing and can be built upon if there is interest.

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