Skip to content

Commit

Permalink
Migrating menus test
Browse files Browse the repository at this point in the history
  • Loading branch information
araujoarthur0 committed Jan 25, 2024
1 parent b09a153 commit ace65ac
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 158 deletions.
16 changes: 15 additions & 1 deletion __mocks__/Mock.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class MockClass
}

/**
* Test related function to get mocking exported methods
* Restore a single mocked method
* @param {string} methodName
*/
restoreMock(methodName)
Expand All @@ -76,6 +76,20 @@ class MockClass
this._mocked[methodName] = false;
}
}

/**
* Restore all mocked methods
*/
restoreAll()
{
for (const [methodName, isMocked] of Object.entries(this._mocked))
{
if (isMocked)
{
this.restoreMock(methodName);
}
}
}
}

export {
Expand Down
Loading

0 comments on commit ace65ac

Please sign in to comment.