![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@scaleway/jest-helpers
Advanced tools
@scaleway/jest-helpers
$ pnpm add @scaleway/jest-functions
import makeHelpers from '@scaleway/jest-helpers'
const Wrapper = ({ children }) => <ThemeProvider>{children}</ThemeProvider>
export const {
renderWithTheme,
shouldMatchEmotionSnapshot,
shouldMatchEmotionSnapshotWithPortal,
} = makeHelpers(Wrapper)
import makeHelpers from '@scaleway/jest-helpers'
import defaultTheme from '..'
interface WrapperProps {
theme?: typeof defaultTheme
}
const Wrapper = ({ theme, children }) => (
<ThemeProvider theme={theme}>{children}</ThemeProvider>
)
export const {
renderWithTheme,
shouldMatchEmotionSnapshot,
shouldMatchEmotionSnapshotWithPortal,
} = makeHelpers(Wrapper)
import makeHelpers from '@scaleway/jest-helpers'
const Wrapper = ({ children }) => <ThemeProvider>{children}</ThemeProvider>
export const {
renderWithTheme,
shouldMatchEmotionSnapshot,
shouldMatchEmotionSnapshotWithPortal,
} = makeHelpers(Wrapper, { classNameReplacer: className => className })
renderWithTheme
Automatically uses CacheProvider
from @emotion/cache
. Use it with a component, optional options & optional theme.
const renderWithTheme = (
component: ReactNode, // The component to render
options?: RenderOptions, // RenderOptions from @testing-library/react
theme?: Theme, // Optional theme to use which will be passed to the Wrapper above
) => ReturnType<typeof render>
shouldMatchEmotionSnapshot
/ shouldMatchEmotionSnapshotWithPortal
Internally it uses the renderWithTheme
generated from above.
const shouldMatchEmotionSnapshot = (
component: ReactNode, // The component to render
options: {
// In an object to make it backward-compatible and don't introduce any API breaking changes
options?: RenderOptions // RenderOptions from @testing-library/react
transform?: (node: ReturnType<typeof render>) => Promise<void> | void // (a)sync function execute between the render and the expect. You can use this if you need mockAllIsIntersecting
theme?: Theme // Optional theme to use which will be passed to the Wrapper above
},
) => Promise<void>
FAQs
A package for utilities jest functions
The npm package @scaleway/jest-helpers receives a total of 53 weekly downloads. As such, @scaleway/jest-helpers popularity was classified as not popular.
We found that @scaleway/jest-helpers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.