-
-
Save stefanpenner/0baadd08d0733f9e8ae0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pause from './helpers/pause'; | |
test("fooo", async () => { | |
await visit('/foo'); | |
await pause(); // will pause here, but can be resumed by typing `resume` | |
await click('#bar'); | |
// some assertions | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let resolve; | |
Object.defineProperty(self, 'resume', { | |
get() { | |
if (resolve) { | |
console.log('resuming...'); | |
resolve(); | |
resolve = undefined; | |
} else { | |
throw TypeError('nothing paused to resumt') | |
} | |
} | |
}) | |
export default async function pause() { | |
if (resolve) { | |
throw TypeError('already paused') | |
} | |
console.log(`test "${QUnit.config.current.testName}" paused. (type "resume" to continue)`, QUnit.config.current.callback); | |
return new Ember.RSVP.Promise(_resolve => resolve = _resolve); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
someone should maybe consider submitting this as an addition to the existing test helpers.