mirror of
https://github.com/datashard/snapshot.git
synced 2024-11-22 06:02:29 +00:00
Compare commits
No commits in common. "a953a3c9e6e2ecbd22cbc22a5c17349d4846f695" and "9351d344a78b183a8b91674eabf5f9b951ea71e1" have entirely different histories.
a953a3c9e6
...
9351d344a7
12 changed files with 3 additions and 10 deletions
|
@ -5,7 +5,6 @@ module.exports = defineConfig({
|
|||
snapshot: {
|
||||
// updateSnapshots: true,
|
||||
useFolders: true,
|
||||
// useSnapshotFolder: true
|
||||
},
|
||||
|
||||
e2e: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@datashard/snapshot",
|
||||
"description": "Adds JSON Snapshot testing support to Cypress",
|
||||
"version": "3.0.0-beta.1",
|
||||
"version": "3.0.0-beta",
|
||||
"author": "Joshua <data@shard.wtf>",
|
||||
"bugs": "https://github.com/datashard/snapshot/issues",
|
||||
"engines": {
|
||||
|
|
|
@ -108,16 +108,10 @@ module.exports = (value, stepName, options = { json: true }) => {
|
|||
value = { data: value };
|
||||
const serializer = pickSerializer(options.json, value);
|
||||
const serialized = serializer(value);
|
||||
let useFolders;
|
||||
if(Cypress.config('snapshot').useSnapshotFolder === undefined || Cypress.config('snapshot').useSnapshotFolder === true) {
|
||||
useFolders = true
|
||||
} else {
|
||||
useFolders = false
|
||||
}
|
||||
options.asFolder = Cypress.config('snapshot').useFolders || false
|
||||
|
||||
set_snapshot({
|
||||
snapshotName: `/${useFolders ? "snapshots/" : ""}${get_snapshot_name(options.asFolder, stepName)}`,
|
||||
snapshotName: `/${get_snapshot_name(options.asFolder, stepName)}`,
|
||||
serialized,
|
||||
value,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue