mochiya98 / mocha-chai-jest-snapshot

provides snapshot testing like jest
MIT License
28 stars 5 forks source link

Snapshot Obsolete Warnings with '.only', '.skip' or '-g' Flag #23

Open cdxOo opened 2 weeks ago

cdxOo commented 2 weeks ago

When using matchSnapshot() in conjunction with 'test.only()', 'test.skip()' or the '-g' Flag I receive a warning about the snapshots from the omitted tests being obsolete (i.e. "1 snapshot obsolete from 1 test suite. To rem....").

In addition this message does not just appear multiple times at once like this:

Snapshot Summary
 › 1 snapshot obsolete from 1 test suite. To remove it, re-run mocha with `--update` to update them.
   ↳ test/tests/emc/front.spec.js
       • emc/create front baseline CASE A 1

Snapshot Summary
 › 1 snapshot obsolete from 1 test suite. To remove it, re-run mocha with `--update` to update them.
   ↳ test/tests/emc/front.spec.js
       • emc/create front baseline CASE A 1

Snapshot Summary
 › 1 snapshot obsolete from 1 test suite. To remove it, re-run mocha with `--update` to update them.
   ↳ test/tests/emc/front.spec.js
       • emc/create front baseline CASE A 1

Snapshot Summary
 › 1 snapshot obsolete from 1 test suite. To remove it, re-run mocha with `--update` to update them.
   ↳ test/tests/emc/front.spec.js
       • emc/create front baseline CASE A 1

Snapshot Summary
 › 1 snapshot obsolete from 1 test suite. To remove it, re-run mocha with `--update` to update them.
   ↳ test/tests/emc/front.spec.js
       • emc/create front baseline CASE A 1

Snapshot Summary
 › 1 snapshot obsolete from 1 test suite. To remove it, re-run mocha with `--update` to update them.
   ↳ test/tests/emc/front.spec.js
       • emc/create front baseline CASE A 1

Snapshot Summary
 › 1 snapshot obsolete from 1 test suite. To remove it, re-run mocha with `--update` to update them.
   ↳ test/tests/emc/front.spec.js
       • emc/create front baseline CASE A 1

  1 passing (969ms)

I am not sure if this is a bug or I am missing something here.