UNPKG

jest-metadata

Version:

🦸‍♂️ Superhero power for your Jest reporters! 🦸‍♀️

53 lines 2.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.$Merge = exports.$Defaults = exports.$Assign = exports.$Unshift = exports.$Push = exports.$Set = exports.metadata = exports.state = void 0; const tslib_1 = require("tslib"); const funpermaproxy_1 = tslib_1.__importDefault(require("funpermaproxy")); const realms_1 = require("./realms"); /** * Aggregated metadata (global state). * Works as intended only in the main process. * Child processes will have their own state, limited to their own tests */ exports.state = realms_1.realm.globalMetadata; /** * Current metadata of a test block that is being added or executed. */ exports.metadata = (0, funpermaproxy_1.default)(() => realms_1.realm.globalMetadata.currentMetadata); /** * Pseudo-annotation that allows to associate metadata with a test block. * It is not an ECMAScript decorator, but it behaves similarly. * Use it to set a single metadata value. */ exports.$Set = realms_1.realm.metadataDSL.$Set; /** * Pseudo-annotation that allows to associate metadata with a test block. * It is not an ECMAScript decorator, but it behaves similarly. * Use it to push a value to an array in metadata. */ exports.$Push = realms_1.realm.metadataDSL.$Push; /** * Pseudo-annotation that allows to associate metadata with a test block. * It is not an ECMAScript decorator, but it behaves similarly. * Use it to prepend a value to an array in metadata. */ exports.$Unshift = realms_1.realm.metadataDSL.$Unshift; /** * Pseudo-annotation that allows to associate metadata with a test block. * It is not an ECMAScript decorator, but it behaves similarly. * Use it to assign multiple values to an object in metadata. */ exports.$Assign = realms_1.realm.metadataDSL.$Assign; /** * Pseudo-annotation that allows to associate metadata with a test block. * It is not an ECMAScript decorator, but it behaves similarly. * Use it to ensure multiple placeholder values to an object in metadata. */ exports.$Defaults = realms_1.realm.metadataDSL.$Defaults; /** * Pseudo-annotation that allows to associate metadata with a test block. * It is not an ECMAScript decorator, but it behaves similarly. * Use it to deeply merge multiple values to an object in metadata. */ exports.$Merge = realms_1.realm.metadataDSL.$Merge; //# sourceMappingURL=index.js.map