]> src.bluestatic.org Git - ustaxlib.git/blob - src/core/Person.test.ts
Simplify the Trace API further.
[ustaxlib.git] / src / core / Person.test.ts
1 // Copyright 2020 Blue Static <https://www.bluestatic.org>
2 // This program is free software licensed under the GNU General Public License,
3 // version 3.0. The full text of the license can be found in LICENSE.txt.
4 // SPDX-License-Identifier: GPL-3.0-only
5
6 import Person, { Relation } from './Person';
7
8 test('static constructors', () => {
9 let p = Person.self('Billy Bob');
10 expect(p.name).toBe('Billy Bob');
11 expect(p.relation).toBe(Relation.Self);
12
13 p = Person.spouse('Sponge Bob');
14 expect(p.name).toBe('Sponge Bob');
15 expect(p.relation).toBe(Relation.Spouse);
16
17 p = Person.dependent('Ted Bob');
18 expect(p.name).toBe('Ted Bob');
19 expect(p.relation).toBe(Relation.Dependent);
20 });