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