Closed philihp closed 3 years ago
@philihp This looks like a really really really old version of Aesthetic.
You would need to register a theme within your testing frameworks setup file.
Should be 5.2.0, and 2.2.1 of aesthetic-react
per https://github.com/Data-2-the-People/skyfall/blob/f1acbc39c2e8be3d7e780cfb2de3d587b951972c/package-lock.json which are the most recents on npm. But it looks like y'all no longer releasing public?
The aesthetic-*
packages have been deprecated for over a year, and have not been worked on since. They have been replaced with a new non-backwards compatible API under @aesthetic/*
.
But it looks line you're using lunar, so just Core.initialize()
in a test setup file. https://github.com/airbnb/lunar/blob/master/test/setup.js#L24
Ah, looks like Lunar is out of date then. I'll take this issue up there.
And for anyone stumbling across this issue, adding to my setup-tests.js
resolved the issue.
import React from 'react'
import lunar from '@airbnb/lunar'
// LUNAR Setup
React.useLayoutEffect = React.useEffect
lunar.initialize({
defaultLocale: 'en',
defaultTimezone: 'UTC',
name: 'abby normal',
})
@philihp Lunar isn't going to upgrade to this new version, so I wouldn't even mention it. The APIs are completely non-compatible, so the migration effort isn't worth it.
Hi!
Tryna test a component that uses
@airbnb/lunar/lib/hooks/useStyles
, and it comes at me withIs there some test setup that must be done for Enzyme/Jest/whatever to register the default theme?
Example repo: https://github.com/Data-2-the-People/skyfall/pull/49