I decided to test the variables functions directly.
the winning incantation is
const wrapper = mountVue(GroupsIndex, { mocks: { $route: { params: { userId: 6 }, query: { zip: 50500 }, }, }, }); // @ts-ignore expect(wrapper .vm .$options .apollo .groups .variables .bind(wrapper.vm)().zip ).toEqual(50500); // @ts-ignore expect( wrapper. vm. $options. apollo. groups. variables. bind(wrapper.vm)().userId ).toEqual(6);
I'm working a mock provider that provides access to stuff thing this so it's a bit less of a dig to test
Thanks!
I posted a short blog post for people about this
dev.to/focusedlabs/testing-apollos...
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I decided to test the variables functions directly.
the winning incantation is
I'm working a mock provider that provides access to stuff thing this so it's a bit less of a dig to test
Thanks!
I posted a short blog post for people about this
dev.to/focusedlabs/testing-apollos...