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 Jan 26, 2023. It is now read-only.
we would like to test our models with the vue-test-utils library.
But somehow the test-utils are not resolving the model, when it's mounted inside @vue/test-utils.createLocalVue.
Implementation
Here is a short example of our model and the test implementation:
import{createLocalVue}from'@vue/test-utils'import{AuthenticationModel}from'./auth'asyncfunctiongenerateAuthenticationModel(): Promise<AuthenticationModel>{constLocalVue=createLocalVue({models: {Auth: AuthenticationModel},})const{ Auth }=LocalVuereturnAuth}it('should be able to login user',async()=>{constAuthenticationTestModel=awaitgenerateAuthenticationModel()expect(AuthenticationTestModel.authenticated).toBeFalsy()awaitAuthenticationTestModel.login({email: '[email protected]',password: 'some-password-that-matches',})expect(AuthenticationTestModel.authenticated).toBeTruthy()})
Expected
LocalVue should be filled with the imported and mounted model
Hit me up, if you need more examples or further explanation. :)
The text was updated successfully, but these errors were encountered:
Hello there,
we would like to test our models with the vue-test-utils library.
But somehow the test-utils are not resolving the model, when it's mounted inside
@vue/test-utils.createLocalVue
.Implementation
Here is a short example of our model and the test implementation:
Expected
LocalVue should be filled with the imported and mounted model
Hit me up, if you need more examples or further explanation. :)
The text was updated successfully, but these errors were encountered: