UNPKG

einvoicing

Version:

A JavaScript library for creating and parsing electronic invoices compliant with the eInvoicing Directive, EN 16931, and popular extensions

33 lines 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var ValueObject_1 = require("./ValueObject"); var TestValueObject = /** @class */ (function (_super) { tslib_1.__extends(TestValueObject, _super); function TestValueObject() { return _super !== null && _super.apply(this, arguments) || this; } TestValueObject.create = function (props) { return new TestValueObject(props); }; return TestValueObject; }(ValueObject_1.ValueObject)); describe('ValueObject', function () { var entity; beforeAll(function () { entity = TestValueObject.create({ name: 'test' }); }); test('base', function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () { var entity2; return tslib_1.__generator(this, function (_a) { entity2 = TestValueObject.create({ name: 'test2' }); expect(entity.equals(entity2)).toBeFalsy(); // same id expect(entity.equals(entity)).toBeTruthy(); // same instance expect(entity.equals(null)).toBeFalsy(); // null // eslint-disable-next-line @typescript-eslint/no-explicit-any expect(entity.equals({ name: 'test' })).toBeTruthy(); // same fields return [2 /*return*/]; }); }); }); }); //# sourceMappingURL=ValueObject.spec.js.map