UNPKG

tcx-builder

Version:
48 lines (47 loc) 1.75 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var chai_1 = require("chai"); var BaseAttribute_1 = require("./BaseAttribute"); var MyClass = /** @class */ (function (_super) { __extends(MyClass, _super); function MyClass(Sport) { var _this = _super.call(this) || this; _this.Sport = Sport; return _this; } return MyClass; }(BaseAttribute_1.BaseAttribute)); var ComplexClass = /** @class */ (function (_super) { __extends(ComplexClass, _super); function ComplexClass() { var _this = _super.call(this) || this; Object.assign(_this, { 'my:key': 'value' }); return _this; } return ComplexClass; }(BaseAttribute_1.BaseAttribute)); describe('BaseAttribute', function () { it('should return str from obj', function () { var obj = new MyClass('Biking'); var str = obj.toString(); chai_1.expect(str).to.equal('Sport="Biking"'); }); it('should return str from complex obj', function () { var obj = new ComplexClass(); var str = obj.toString(); chai_1.expect(str).to.equal('my:key="value"'); }); });