feat(admin,admin-ui,medusa): Add Medusa Admin plugin (#3334)
This commit is contained in:
committed by
GitHub
parent
d6b1ad1ccd
commit
40de54b010
@@ -1,5 +1,7 @@
|
||||
const { server } = require("./mocks/server")
|
||||
|
||||
const originalError = console.error
|
||||
|
||||
beforeAll(() => {
|
||||
server.listen({
|
||||
onUnhandledRequest: (req) => {
|
||||
@@ -7,6 +9,25 @@ beforeAll(() => {
|
||||
console.log(req)
|
||||
},
|
||||
})
|
||||
|
||||
/**
|
||||
* We are currently using a deprecated library for testing - `@testing-library/react-hooks`.
|
||||
* This library uses `ReactDOM.render` which is deprecated in React 18. This is a temporary
|
||||
* fix to silence the warning.
|
||||
*
|
||||
* TODO: Replace the usage of `@testing-library/react-hooks` with
|
||||
* the latest `@testing-library/react` and remove this fix.
|
||||
*/
|
||||
console.error = (...args) => {
|
||||
if (
|
||||
/Warning: ReactDOM.render is no longer supported in React 18./.test(
|
||||
args[0]
|
||||
)
|
||||
) {
|
||||
return
|
||||
}
|
||||
originalError.call(console, ...args)
|
||||
}
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -18,4 +39,7 @@ afterEach(() => {
|
||||
window.localStorage.clear()
|
||||
})
|
||||
|
||||
afterAll(() => server.close())
|
||||
afterAll(() => {
|
||||
server.close()
|
||||
console.error = originalError
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user