pauseTest() does not work as expected
See original GitHub issueCurrently the pauseTest()
helper doesn’t work properly with mocha due to its test timeouts. If you call this.timeout(0);
before using pauseTest()
it will work, but obviously it would be better if this could be done automatically.
Is it possible for us to overwrite the original pauseTest()
helper and add one that first calls this.timeout(0)
and the original code afterwards?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:10 (8 by maintainers)
Top Results From Across the Web
'ReferenceError: pauseTest is not defined' in integration tests ...
It's working fine in Acceptance tests, because of: // ./tests/helpers/start-app.js export default function startApp( ...
Read more >Testing Application - Ember Guides
In order to help you understand why, pauseTest() and resumeTest() can help you. To try them out, do the following steps: Add await...
Read more >Productive debugging - DockYard
Inserting a call to pauseTest() inside an acceptance test will pause the test suite at the point that it sees the function call....
Read more >How to Debug Cypress Tests : Tutorial | BrowserStack
//debugger might not work in expected way it('Click on Sign In', () => { cy.get('a[title="Sign In"]').click() debugger; }).
Read more >ember-qunit | Yarn - Package Manager
... #497 Work around issue with pauseTest() timing out. ... #165; Called start() outside of a test context #143; problem returning application from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This has been solved with the new testing API released in v0.14.0
I’ve been playing around with this some, and have had trouble overriding the existing
pauseTest
helper to set the timeout. However, introducing a new helper works.What I did to override the existing helper was adding this to the
test-helper.js
for a demo app:My hope was that setting the
timeout
in here would override the default value of2000
and cause the test now to fail. However, this doesn’t work; I’m guessing that’s the case because the context (this
) of thebefore
hook needs to be set up before theit
callback is called, but in this case we’re setting it after the test has already started.What did work was setting up a new helper, like this:
In this case, the tests passes the context into the helper, like:
So now it can set the timeout correctly, because it’s accessing the context of the
it
callback instead of the context of thebefore
.I’ve tried to see if there’s some way to access the
it
context from thebefore
but it doesn’t seem possible. How do you feel about “solving” this with a new helper?