-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sortSnapshots config option
- Loading branch information
Showing
6 changed files
with
142 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# test-custom-pre-fn | ||
|
||
This repo shows how `snap-shot-it` can load a custom pre-compare function via config in `package.json` file and use it to clean up data before comparing. | ||
|
||
See https://github.com/bahmutov/snap-shot-it/issues/350 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "test-custom-pre-fn", | ||
"version": "1.0.0", | ||
"description": "shows custom pre-compare function", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "../node_modules/.bin/mocha 'specs/**/*.js'" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"config": { | ||
"snap-shot-it": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const snapshot = require('../..') | ||
|
||
/* eslint-env mocha */ | ||
it('has names in reverse order', () => { | ||
// notice that snapshots are named NOT in sorted order | ||
snapshot('zz', 3) | ||
snapshot('bb', 2) | ||
snapshot('aa', 1) | ||
}) |