fusionjs / fusion-test-utils

Migrated to https://github.com/fusionjs/fusionjs
MIT License
5 stars 17 forks source link

Expose pass-through of snapshotName argument for `matchSnapshot` #126

Closed abmai closed 6 years ago

abmai commented 6 years ago

This is poorly documented by Jest; but it is available. It allows users to provide custom names for snapshots so the following code

test('it does render', (t) => {
  t.matchSnapshot('snapshot name');
});

Generates this snapshot name

exports[`it does render: snapshot name 1`] = ...

Documented here: https://facebook.github.io/jest/docs/en/expect.html#tomatchsnapshotpropertymatchers-snapshotname

And then the single-argument works because of here: https://github.com/facebook/jest/blob/master/packages/jest-snapshot/src/index.js#L57

codecov[bot] commented 6 years ago

Codecov Report

Merging #126 into master will decrease coverage by 1.29%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #126     +/-   ##
=========================================
- Coverage   88.05%   86.76%   -1.3%     
=========================================
  Files           3        3             
  Lines          67       68      +1     
  Branches        9        9             
=========================================
  Hits           59       59             
- Misses          6        7      +1     
  Partials        2        2
Impacted Files Coverage Δ
src/index.js 72.41% <0%> (-2.59%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 04172aa...45eb2b4. Read the comment docs.

KevinGrandon commented 6 years ago

!merge