UNPKG

@contract-case/case-core

Version:

Core functionality for the ContractCase contract testing suite

14 lines 771 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IntegerMatcher = void 0; const case_plugin_base_1 = require("@contract-case/case-plugin-base"); const check = (matcher, matchContext, actual) => (0, case_plugin_base_1.combineResults)((0, case_plugin_base_1.errorWhen)(!Number.isInteger(actual), (0, case_plugin_base_1.matchingError)(matcher, 'Expected an integer', actual, matchContext))); exports.IntegerMatcher = { describe: (matcher, matchContext) => matchContext['_case:context:matchBy'] === 'exact' ? `${matcher['_case:matcher:example']}` : '<any integer>', check, strip: (matcher) => matcher['_case:matcher:example'], validate: () => Promise.resolve(), }; //# sourceMappingURL=IntegerMatcher.js.map