1
0
Fork 0
mirror of https://github.com/datashard/snapshot.git synced 2025-05-09 17:47:21 +00:00
snapshot/src/utils/functions/register.js
2023-02-20 19:17:38 +01:00

13 lines
444 B
JavaScript

const lazy = require("lazy-ass");
const is = require("check-more-types");
const snapshot = require("../snapshots/snapshot");
module.exports = () => {
lazy(is.fn(global.before), "Missing global before function");
lazy(is.fn(global.after), "Missing global after function");
lazy(is.object(global.Cypress), "Missing Cypress object");
Cypress.Commands.add("snapshot", { prevSubject: true }, snapshot);
return snapshot;
};