_dayjs.default.months is not a function
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
I use dayjs.months() it's work in a project, but when I try to test with jest, test failed with TypeError: _dayjs.default.months is not a function
Expected behavior
Expected that test passed, because I couldn't see this error in Chrome log
Can you give advice how to solve this problem or work around?
Information
- Day.js Version [e.g. v1.10.7]
- OS: [e.g. Windows 11]
- Browser [e.g. chrome 119.0.6045.200]
- Time zone: [e.g. GMT+06:00 DST (Pacific Daylight Time)]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the dayjs.months() call under Jest and compare that setup with the browser case described in the issue. Check whether the reported TypeError is reproducible with the provided information; done means identifying a concrete Jest configuration or usage cause and documenting a verified fix or workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100