Vscode-jest: Remove obsolete snapshots

Created on 7 Mar 2018  路  3Comments  路  Source: jest-community/vscode-jest

Environment

  1. node -v: v8.4.0
  2. npm -v: 5.3.0
  3. npm ls react-scripts (if you haven鈥檛 ejected): N/A

  4. Operating system: macOS High Sierra Version 10.13.3

Steps to Reproduce

  1. Open a test file that contains a snapshot expectation
  2. Add a snapshot expectation (this will get generated)
  3. Remove snapshot expectation (this will not get removed)

Expected Behavior

Removal of snapshot expectation would remove obsolete snapshot (or a dialog would appear asking if I'd like to update my snapshots and remove obsolete)

Actual Behavior

Removal of snapshot expectation does not remove obsolete snapshot (or show a dialog asking if I'd like to update my snapshots and remove obsolete)


Am I misunderstood? It seems that if I add a new snapshot expectation, I will be prompted to update my snapshots and this will remove any obsolete; however, this is not an ideal workflow.

I started using this extension to replace the need to run my tests in the terminal, but it seems I may need to still do this in the case where I have obsolete snapshots.

enhancement

Most helpful comment

I just run jest --updateSnapshot and that flag removes obsolete snapshots

All 3 comments

Makes sense, want to try take a look at adding this?

+1

I just run jest --updateSnapshot and that flag removes obsolete snapshots

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karb0f0s picture karb0f0s  路  37Comments

jackfranklin picture jackfranklin  路  19Comments

erikns picture erikns  路  16Comments

Glutnix picture Glutnix  路  37Comments

Pajn picture Pajn  路  31Comments