Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: watch reactive array callback with array of undefined #1656

Merged
merged 1 commit into from
Jul 20, 2020

Conversation

tanhauhau
Copy link
Contributor

@tanhauhau tanhauhau commented Jul 20, 2020

fixes #1655

if check if array first, the array could be a reactive array.

it('watching single source: array', async () => {
const array = reactive([] as number[])
let dummy
watch(array, (array, prevArray) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test should rather pass a spy jest.fn() and check the amount of times the spy is called and with what arguments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay.. let me change it. i just copied from the convention of the previous tests 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the test

@yyx990803 yyx990803 merged commit 288b4ea into vuejs:master Jul 20, 2020
@tanhauhau tanhauhau deleted the tanlh/fix/watch branch July 20, 2020 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

watch reactive array callback called with array of undefined
3 participants