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
pending() in beforeEach does not stop execution #1579
Comments
The current mechanism for this is the I would also be happy to review a pull request that makes Hope this helps. Thanks for using Jasmine! |
We hit a similar issue, but I am confused by the answer here. If we set |
|
Thanks, so what should |
A call to This may be a future looking statement, I'm not sure that Jasmine has any tests that assert on the interaction of |
Calling pending only works for beforeEach jasmine/jasmine#1579 And the stopSpecOnExpectationFailure setting only works for node cli. Have to use oneFailurePerSpec for karma-jasmine: karma-runner/karma-jasmine#218
Calling pending only works for beforeEach jasmine/jasmine#1579 And the stopSpecOnExpectationFailure setting only works for node cli. Have to use oneFailurePerSpec for karma-jasmine: karma-runner/karma-jasmine#218
Calling pending only works for beforeEach jasmine/jasmine#1579 And the stopSpecOnExpectationFailure setting only works for node cli. Have to use oneFailurePerSpec for karma-jasmine: karma-runner/karma-jasmine#218
cf jasmine/jasmine#1579, when marking a spec as pending in before each without `oneFailurePerSpec`, spec will continue its execution silently. this behavior generated random failure due to inconsistent state: ``` logger session ✗ should renew on activity after expiration Unable to get property 'notify' of undefined or null reference thrown Unable to get property 'notify' of undefined or null reference thrown Unable to get property 'notify' of undefined or null reference thrown Unable to get property 'notify' of undefined or null reference thrown Error: Mock clock is not installed, use jasmine.clock().install() at <Jasmine> at Anonymous function (eval code:17:9) at <Jasmine> ```
cf jasmine/jasmine#1579, when marking a spec as pending in before each without `oneFailurePerSpec`, spec will continue its execution silently. this behavior generated random failure due to inconsistent state: ``` logger session ✗ should renew on activity after expiration Unable to get property 'notify' of undefined or null reference thrown Unable to get property 'notify' of undefined or null reference thrown Unable to get property 'notify' of undefined or null reference thrown Unable to get property 'notify' of undefined or null reference thrown Error: Mock clock is not installed, use jasmine.clock().install() at <Jasmine> at Anonymous function (eval code:17:9) at <Jasmine> ```
* ✅ [unit] ensure that global objects are always clean fix ''getInternalContext' not yet available, please call '.init()' first.' warning * ✅ [unit] stop spec execution on failure/pending cf jasmine/jasmine#1579, when marking a spec as pending in before each without `oneFailurePerSpec`, spec will continue its execution silently. this behavior generated random failure due to inconsistent state: ``` logger session ✗ should renew on activity after expiration Unable to get property 'notify' of undefined or null reference thrown Unable to get property 'notify' of undefined or null reference thrown Unable to get property 'notify' of undefined or null reference thrown Unable to get property 'notify' of undefined or null reference thrown Error: Mock clock is not installed, use jasmine.clock().install() at <Jasmine> at Anonymous function (eval code:17:9) at <Jasmine> ``` * trigger ci
With this value to false, the tests are kind of failing on IE where we mark some test suite as "pending" in the `beforeEach` callback. This is a known issue in Jasmine jasmine/jasmine#1579
* [RUMF-759] use RUM_EVENT_COLLECTED events to test sent events With the newly introduced RUM_EVENT_COLLECTED and RUM_EVENT_V2_COLLECTED, we can test for generated events without the need to retrieve them from a mocked server. This simplifies the unit tests a bit. * [RUMF-759] introduce withConfiguration This new helper allows to edit the configuration before any `beforeBuild` callback is invoked. It slightly simplifies the FF edition. * [RUMF-759] replace the performance observer stub with a spy * [RUMF-759] use an object for beforeBuild This will allow us to provide more data for beforeBuild callbacks * [RUMF-759] allow to return a cleanup callback A few spec helper methods that could be inlined in their spec are using a cleanup function. To allow moving them, we add a way to define a cleanup function in beforeBuild callbacks. * [RUMF-759] inline withViewCollection in trackViews spec * [RUMF-759] inline withActionCollection in the trackActions spec * [RUMF-759] inline withPerformanceCollection in the performanceCollection spec * [RUMF-759] inline withParentContexts() in parentContexts spec * [RUMF-759] inline withRum in rum spec * [RUMF-759] inline withInternalContext in internalContext spec * [RUMF-759] inline withAssembly / withAssemblyV2 in assembly specs * restore oneFailurePerSpec: true With this value to false, the tests are kind of failing on IE where we mark some test suite as "pending" in the `beforeEach` callback. This is a known issue in Jasmine jasmine/jasmine#1579 * 👌 return an object with a `stop` method for cleanup
Expected Behavior
Calling pending() in beforeEach should allow the user to prevent further execution of a spec.
Current Behavior
Calling pending() in the spec itself stops spec execution while calling it in beforeEach only marks the test as pending but does not stop execution.
Suite that reproduces the behavior (for bugs)
./node_modules/.bin/jasmine --random=false dummy.spec.js
ofprints
Context
In our environment we want to selectively stop test execution for client-server tests when server is not there. Marking the spec as pending is not sufficient since a complex initialization is started that leads to some very hard to debug exceptions in afterAll.
Your Environment
The text was updated successfully, but these errors were encountered: