UNPKG

jest-rdf

Version:
27 lines 944 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const rdf_string_1 = require("rdf-string"); function fail(received, actual) { return { message: () => `expected ${(0, rdf_string_1.termToString)(received)} and ${(0, rdf_string_1.termToString)(actual)} to be equal`, pass: false, }; } function succeed(received, actual) { return { message: () => `expected ${(0, rdf_string_1.termToString)(received)} and ${(0, rdf_string_1.termToString)(actual)} not to be equal`, pass: true, }; } exports.default = { toEqualRdfTerm(received, actual) { if (received.termType !== actual.termType) { return fail(received, actual); } if (received.termType !== 'BlankNode' && !received.equals(actual)) { return fail(received, actual); } return succeed(received, actual); }, }; //# sourceMappingURL=toEqualRdfTerm.js.map