Commit | Line | Data |
---|---|---|
a9026868 JB |
1 | import { describe, it } from 'node:test'; |
2 | ||
3 | import { expect } from 'expect'; | |
4 | ||
5 | import { ACElectricUtils, DCElectricUtils } from '../../src/utils/ElectricUtils'; | |
6 | ||
7 | await describe('ElectricUtils test suite', async () => { | |
8 | await it('Verify DCElectricUtils.power()', () => { | |
9 | expect(DCElectricUtils.power(230, 1)).toBe(230); | |
10 | }); | |
11 | await it('Verify DCElectricUtils.amperage()', () => { | |
12 | expect(DCElectricUtils.amperage(1, 230)).toBe(0); | |
13 | }); | |
14 | await it('Verify ACElectricUtils.powerTotal()', () => { | |
15 | expect(ACElectricUtils.powerTotal(3, 230, 1)).toBe(690); | |
16 | }); | |
17 | await it('Verify ACElectricUtils.powerPerPhase()', () => { | |
18 | expect(ACElectricUtils.powerPerPhase(230, 1)).toBe(230); | |
19 | }); | |
20 | await it('Verify ACElectricUtils.amperageTotal()', () => { | |
21 | expect(ACElectricUtils.amperageTotal(3, 1)).toBe(3); | |
22 | }); | |
23 | await it('Verify ACElectricUtils.amperageTotalFromPower()', () => { | |
24 | expect(ACElectricUtils.amperageTotalFromPower(690, 230)).toBe(3); | |
25 | }); | |
26 | await it('Verify ACElectricUtils.amperagePerPhaseFromPower()', () => { | |
27 | expect(ACElectricUtils.amperagePerPhaseFromPower(3, 690, 230)).toBe(1); | |
28 | }); | |
29 | }); |