UNPKG

domain-objects

Version:

A simple, convenient way to represent domain objects, leverage domain knowledge, and add runtime validation in your code base.

20 lines 721 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const DomainEntity_1 = require("../instantiation/DomainEntity"); describe('DomainUniqueKeys', () => { it('should accurately extract the unique keys of an entity', () => { class SeaTurtle extends DomainEntity_1.DomainEntity { } SeaTurtle.unique = ['seawaterSecurityNumber']; // should be correct const uniqueKeysRight = [ 'seawaterSecurityNumber', ]; // should be invalid const uniqueKeysWrong = [ // @ts-expect-error - saltwater != seawater 'saltwaterSecurityNumber', ]; }); }); //# sourceMappingURL=DomainUniqueKeys.test.js.map