File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,12 @@ module.exports = function() {
2121 self . startMocking ( strict ) ;
2222 } ) ;
2323
24+ this . Then ( / ^ I c l e a r t h e A p i L o g $ / , function ( ) {
25+ client . execute ( function ( ) {
26+ return require ( 'xhr-mock' ) . clearLog ( ) ;
27+ } ) ;
28+ } ) ;
29+
2430 this . Given ( / ^ I l o a d p r e r e c o r d e d m o c k s f r o m " ( [ ^ " ] * ) " $ / , function ( path ) {
2531 var absolutePath = process . cwd ( ) + "/" + path ;
2632 // use map & Object.assign to make a copy
Original file line number Diff line number Diff line change @@ -470,6 +470,13 @@ module.exports = function() {
470470 return MockXMLHttpRequest . _made_requests ;
471471 } ,
472472
473+ /**
474+ * empty the log of requests
475+ */
476+ clearLog : function ( ) {
477+ MockXMLHttpRequest . _made_requests = [ ] ;
478+ } ,
479+
473480 /**
474481 * Mock a request
475482 * @param {string } [method]
You can’t perform that action at this time.
0 commit comments