UNPKG

type-fns

Version:

A set of types, type checks, and type guards for simpler, safer, and easier to read code.

17 lines 732 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const hasId_1 = require("../checks/hasId"); const withNot_1 = require("./withNot"); describe('withNot', () => { it('should return false if an object has an id after wrapping hasId', () => { const obj = { id: 821, name: 'bob' }; const itDoesNotHaveId = (0, withNot_1.withNot)(hasId_1.hasId)(obj); expect(itDoesNotHaveId).toEqual(false); }); it('should return false if an object does not have an id', () => { const obj = { name: 'bob' }; const itDoesNotHaveId = (0, withNot_1.withNot)(hasId_1.hasId)(obj); expect(itDoesNotHaveId).toEqual(true); }); }); //# sourceMappingURL=withNot.test.js.map