Skip to content

Difference on snapshot with and without coverage #3521

Open
@DaedalusDev

Description

@DaedalusDev

Version

3.4.1

Reproduction link

https://github.com/DaedalusDev/vue-issue-snapshot-istanbul

Environment info

Environment Info:

  System:
    OS: Linux 3.13 Ubuntu 14.04.5 LTS, Trusty Tahr
    CPU: (8) x64 Intel(R) Xeon(R) CPU E5-1620 v3 @ 3.50GHz
  Binaries:
    Node: 8.12.0 - ~/node-current/bin/node
    Yarn: 1.3.2 - ~/node-current/bin/yarn
    npm: 6.4.1 - ~/node-current/bin/npm
  Browsers:
    Chrome: 72.0.3626.81
    Firefox: 52.3.0
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.2 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.2 
    @vue/babel-preset-app:  3.4.1 
    @vue/babel-preset-jsx:  1.0.0-beta.2 
    @vue/babel-sugar-functional-vue:  1.0.0-beta.2 
    @vue/babel-sugar-inject-h:  1.0.0-beta.2 
    @vue/babel-sugar-v-model:  1.0.0-beta.2 
    @vue/babel-sugar-v-on:  1.0.0-beta.2 
    @vue/cli-overlay:  3.4.1 
    @vue/cli-plugin-babel: ^3.2.0 => 3.4.1 
    @vue/cli-plugin-eslint: ^3.2.0 => 3.4.1 
    @vue/cli-plugin-unit-jest: ^3.2.0 => 3.4.1 
    @vue/cli-service: ^3.2.0 => 3.4.1 
    @vue/cli-shared-utils:  3.4.1 
    @vue/component-compiler-utils:  2.6.0 
    @vue/eslint-config-standard: ^4.0.0 => 4.0.0 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/test-utils: ^1.0.0-beta.20 => 1.0.0-beta.29 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.2 
    jest-serializer-vue:  2.0.2 
    vue: ^2.6.6 => 2.6.7 
    vue-eslint-parser:  2.0.3 
    vue-hot-reload-api:  2.3.3 
    vue-jest:  3.0.3 
    vue-loader:  15.6.4 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.5.21 => 2.6.7 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: 3.2.1

Steps to reproduce

Create a snapshot test with Jest. A nested component will have a function has props.

Run npm run test:unit. All tests match.

Run ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit --coverage. Test will fail.

What is expected?

The snapshot should match.

What is actually happening?

Istanbul had the following to snapshot :

/* istanbul ignore next */cov_276pwzto1v.f[2]++;
cov_276pwzto1v.s[14]++;

This make tests failing.


Thanks for your great job.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions