UNPKG

type-fns

Version:

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

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