File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export default class Retry {
1212 testFn ( ...args , async ( assert , ...callbackArgs ) => {
1313 this . assertProxy = new Proxy ( assert , this . assertResultHandler )
1414 this . callbackArgs = callbackArgs
15+ assert . test . assert = this . assertProxy
1516 this . currentRun = 1
1617 await this . retry ( this . currentRun )
1718 } )
Original file line number Diff line number Diff line change @@ -246,6 +246,22 @@ QUnit.module('assert.expect', function () {
246246 } )
247247} )
248248
249+ QUnit . module ( 'assert.throws' , function ( ) {
250+ const calls = [ ]
251+
252+ retry ( 'count retries' , function ( assert , currentRun ) {
253+ calls . push ( currentRun )
254+
255+ assert . throws ( ( ) => {
256+ if ( currentRun === 2 ) throw new Error ( 'fail' )
257+ } )
258+ } )
259+
260+ QUnit . test ( 'verify calls' , function ( assert ) {
261+ assert . deepEqual ( calls , [ 1 , 2 ] )
262+ } )
263+ } )
264+
249265QUnit . module ( 'retry.todo' , function ( ) {
250266 const calls = [ ]
251267
You can’t perform that action at this time.
0 commit comments