-
Notifications
You must be signed in to change notification settings - Fork 14
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
Rethinking the Karma Test Adapter #9
Comments
I have now made a prerelease of the next version of the karma test adapter.
Before I publish this version, I would really appreciate it if some of the users of the adapter could test |
Based on your comments, would another adapter extension of this sort have to be written in order to support running Protractor-based (Jasmine) tests from Visual Studio? I would imagine there would be a fair amount of code overlap...would it make more sense for something like that to be a fork of this project, or a separate project? I'll test your alpha. |
@jitterbox I must admit that I have not looked a Protractor before now. My initial feeling is that the Karma Test Adapter is currently quite closely coupled to Karma. So I would think that another adapter should be written for Protractor. It might be possible to refactor the Karma Test Adapter so code overlap could be avoided. However, I think it would take a bit of work. 😄 Thank you very much for testing the alpha (now: v1.0.0-alpha.3), it is greatly appreciated! |
As described in karma-runner/karma#1213 Karma sometimes fails when files it watches are changed. Therefore, as of v1.0.0-alpha.4, the adapter will restart Karma if it fails. |
I have now published version 1.0.0 of the adapter. |
When I initially implemented the Karma Test Adapter I made the assumption, that it would be possible to statically analyze test files to discover tests by parsing them.
Since then I have learned:
_There is no (easy) way to discover tests without running them!_
In this simple example it would be hard to determine test names just by parsing:
A test adapter for the Visual Studio test explorer has three phases:
In our case this would be
karma.conf.js
orkarma-vs-reporter.json
.This is where the current version of the Karma Test Adapter parses the test files to discover tests. As I have learned, this is very fragile, and can easily fail.
The current version of the Karma Test Adapter "tells" Karma to run the tests.
Based on this I am working on a rewrite of the Karma Test Adapter. The new adapter will:
karma.conf.js
orkarma-vs-reporter.json
change karma in the background will be restarted using the changed settings.karma-vs-reporter.json
it will be possible to turn off the adapter.The fact that test files will no longer be parsed to find tests leads to the following:
describe
andit
to include this information in the test results using a stack trace.The text was updated successfully, but these errors were encountered: