-
Notifications
You must be signed in to change notification settings - Fork 1
Remove logs from UI library #21
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
src/app/[locale]/page.tsx
Outdated
/** | ||
* @dev temporary removing some logs in client. | ||
*/ | ||
require("../../../tools/removeLogs"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't use alias? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly no, it doesn't work in test ... Idk why. Look at my second commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you do
require("../../../tools/removeLogs"); | |
import "@/tools/removeLogs" |
This don't works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok when doing that I had an error saying that the file wasn't a module so I just added module.exports = {}
and it worked. Cool, thanks for the heads up @mcayuelas-ledger !
jest.setup.js
Outdated
/** | ||
* @dev temporary removing some logs. | ||
*/ | ||
require("./tools/removeLogs"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not mix require and import. You can use an import here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
/** | ||
* @dev temporary removing some logs in client. | ||
*/ | ||
import("@/tools/removeLogs"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should parse errors only for tests. I'm not convinced doing that at runtime for the client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even for the server
π Description
Temporarily removing logs coming from
@ledgerhq/react-ui
for test and client/server components. It's much easier to develop.β Context
πΈ Demo
π Expectations to reach
Pull Requests must pass the CI and be internally validated in order to be merged.