-
Notifications
You must be signed in to change notification settings - Fork 311
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
Comparison of Intern with other popular testing frameworks #1019
Comments
I have experience mainly with Jasmine + Karma and Jest so I'll discuss those two here. Since they are similar much of the feedback is true about both. What features do these tools have that Intern lacks, or only partially implements?
What testing tasks are easier with these tools than with Intern?
How does the interaction model of these tools (cli, interactivity, etc) compare to Intern's?I've used both the karma and jest CLIs but after setting up some npm scripts generally didn't use the CLI very much with the following exceptions
Debugging in Karma is an interesting story. It is nice to be able to debug directly in the browser tools without needing to do much more than opening a tab. Jest you generally need to console.log or setup remote debugging. |
Potential issues from this discovery: Add / improve watch modeSee #1020 Implement test parallelizationThe basic strategy here would be to let Intern spawn pools of worker endpoints and then feed them tests. This could use a similar implementation to the browser support mentioned in the watch mode issue. Remote sessions could be updated to wait for instructions, do tasks, and then go back to waiting. Implement snapshot testingThis one's a bit tricker, and probably needs its own discovery issue. Intern doesn't focus on any one UI system, so the problem scope is wide. Module mockingA built in mocking solution has been a long standing request. This is another issue that probably needs its own discovery issue to determine what we'd want out of a mocking solution. Intern's own self tests now use a type-safe module mocking solution built on rewiremock. A combination of that and Sinon could serve as a default mocking toolkit. In any case, even if Intern provides a default solution, users should still be able to easily load alternatives. Simplify working on a single test or suiteIntern currently allows working on single tests or suites via the The initial effort should be to more clearly document, at least in Intern's "how to" page, how to restrict test execution using The more involved effort should be to implement a solution for restricting test execution. This solution would work by looking for "only" makers, either during suite/test registration or just before tests are run. If any such makers were seen, only the marked tests/suites would be executed. This solution would not work on tests dynamically generated during a test run, but it would work for tests generated by plugins in Configuration improvementsAdd conventional behavior to Intern to allow it to run without configuration. The main requirement would be some default suite loading behavior. For example, Intern could have default suites values:
Intern's suite loading logic could be updated to automatically try ".ts" files if ".js" files weren't present. Interactive debuggingA low bar task for this would be to document how to use Intern with Node's |
Thoughts from working w/ jest for the last year...
|
Those are great! Some new issues we can pull from that... Add a default interface to the global scopeIntern should add a test interface and an assertion interface to the global scope. By default this could be Include a lower-level mocking solutionAlong with module mocking (replacement, really), a built-in way to quickly generate spies and stubs would be useful. Intern could expose some or all of Sinon's API for this purpose. Create a WebStorm extensionThis is related to the "VS Code extension" task in #1021. Both extensions would serve the same purpose, and would likely have very similar implementations. The extensions should allow individual tests to be executed, and the results should be displayed in the host IDE. |
I would personally prefer to rely on auto es6 imports over using the global scope for the bdd interface. It should also make the typings simpler. Functional Testing ComparisonOne testing tool we should also talk about is Cypress. It takes a completely different approach by not using Selenium, but there might be some lessons to learn from their API. Things I like
Things I don't Like
|
Hmmm...auto imports aren't quite as user-friendly or as universally available, but they're definitely easier to implement (in that they work now -- done! 😄). It might be useful to provide an off-by-default option to enable a global interface.
This is something we do now (explicitly deferring to chai) that's always seemed kind of kludgey to me. I think we should continue using chai, and should possibly include sinon, too, but it would be nice if we could make them feel a bit more integrated. If nothing else we could re-export them (or the relevant parts) from intern, just so we don't have to rely on a flat npm install for the packages to be available to users.
Is this different from how webdriver selectors work? (e.g., a
That's definitely an area Intern do more with. Like, automatically taking screenshots for failing tests would bee pretty great. |
Based of my experience with Mocha, I actually prefer not having magical test environments:
It's easier for me to remember |
Good point. In general, less magic is better. |
I think what is special about cypress is that Cypress retries the selector and assertion together. The cypress docs have an example of if you are selecting a list of items and there is a delay before it appears you can assert the number of returned items and it will still pass. Part of this is enabled because Cypress doesn't run the commands immediately. I will say that the Cypress retryable logic is hard to remember when writing tests. For example, selecting items in a list and then selecting elements within the returned elements doesn't retry. If intern adds similar logic I would encourage keeping it simple to follow. Cypress has a page with all the intricacies of retries in their docs. |
Ah, Cypress's retry, at least for a list-of-items example, is kind of like Intern's |
See #514 for fdescribe/fit support. |
Closing this as discovered. Outcomes:
|
The goal of this issue is to compare Intern to other popular testing tools to discover potential areas of improvement for Intern.
A few questions we should answer (plus anything else that seems relevant):
The text was updated successfully, but these errors were encountered: