You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
🐛 The bug
Upgrading to version v.0.23.0 (https://github.com/nuxt-community/composition-api/releases/tag/0.23.0) breaks testing with Jest. Namely, the setup() function in a component is never being called. Note that the application works as expected. It's only the tests that are showing odd behavior.
My assumption is that the 'auto-mock' is not working as expected, outside a Nuxt context. Hoping someone can help!
I've followed the release notes to update my app to do the following:
With the upgrade, nothing in the setup() method is being executed, however, the component still compiles. If i reorganized a dummy component to use a data prop, for example, the tests would attach the value to mounted compnent's vm property.
🛠️ To reproduce
Steps to reproduce the behavior:
Install version v0.22.4
Add the composition api to your buildModules ( buildModules: ['@nuxtjs/composition-api'],)
Add the entrypoint to the moduleNameMapper ( '@nuxtjs/composition-api': '@nuxtjs/composition-api/entrypoint',)
Write a dummy component with a setup function that returns an object with some key/value pairs (`setup(){ return {foo:'bar'} }
Write a dummy test for the component. Console log a value that was returned by the components setup() method. Example
🐛 The bug
Upgrading to version
v.0.23.0
(https://github.com/nuxt-community/composition-api/releases/tag/0.23.0) breaks testing with Jest. Namely, thesetup()
function in a component is never being called. Note that the application works as expected. It's only the tests that are showing odd behavior.My assumption is that the 'auto-mock' is not working as expected, outside a Nuxt context. Hoping someone can help!
I've followed the release notes to update my app to do the following:
nuxt.config
FROM:
TO:
jest.config
FROM:
TO:
With the upgrade, nothing in the setup() method is being executed, however, the component still compiles. If i reorganized a dummy component to use a
data
prop, for example, the tests would attach the value to mounted compnent'svm
property.🛠️ To reproduce
Steps to reproduce the behavior:
v0.22.4
buildModules: ['@nuxtjs/composition-api'],
)'@nuxtjs/composition-api': '@nuxtjs/composition-api/entrypoint',
)setup()
method. Examplev0.23.0
nuxt.config
(buildModules: ['@nuxtjs/composition-api/module'],
)moduleNameMapper
fromjest.config
undefined
🌈 Expected behaviour
I expected that the tests that passed prior to the upgrade would also pass after the upgrade.
The text was updated successfully, but these errors were encountered: