jest-metadata
Version:
🦸♂️ Superhero power for your Jest reporters! 🦸♀️
40 lines • 1.41 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetadataVisitor = void 0;
class MetadataVisitor {
checker;
constructor(checker) {
this.checker = checker;
}
visit(metadata) {
if (this.checker.isGlobalMetadata(metadata)) {
this.visitGlobal(metadata);
}
else if (this.checker.isTestFileMetadata(metadata)) {
this.visitTestFile(metadata);
}
else if (this.checker.isDescribeBlockMetadata(metadata)) {
this.visitDescribeBlock(metadata);
}
else if (this.checker.isHookDefinitionMetadata(metadata)) {
this.visitHookDefinition(metadata);
}
else if (this.checker.isTestEntryMetadata(metadata)) {
this.visitTestEntry(metadata);
}
else if (this.checker.isHookInvocationMetadata(metadata)) {
this.visitHookInvocation(metadata);
}
else if (this.checker.isTestInvocationMetadata(metadata)) {
this.visitTestInvocation(metadata);
}
else if (this.checker.isTestFnInvocationMetadata(metadata)) {
this.visitTestFnInvocation(metadata);
}
else {
throw new TypeError(`Unknown metadata type: ${metadata.constructor.name}`);
}
}
}
exports.MetadataVisitor = MetadataVisitor;
//# sourceMappingURL=MetadataVisitor.js.map