Reformat all files with prettier

This commit is contained in:
Pieter Vander Vennet 2022-09-08 21:40:48 +02:00
parent e22d189376
commit b541d3eab4
382 changed files with 50893 additions and 35566 deletions

View file

@ -1,29 +1,27 @@
import {describe} from 'mocha'
import {expect} from 'chai'
import {Unit} from "../../Models/Unit";
import {Denomination} from "../../Models/Denomination";
import { describe } from "mocha"
import { expect } from "chai"
import { Unit } from "../../Models/Unit"
import { Denomination } from "../../Models/Denomination"
describe("Unit", () => {
it("should convert a value back and forth", () => {
const denomintion = new Denomination({
"canonicalDenomination": "MW",
"alternativeDenomination": ["megawatts", "megawatt"],
"human": {
"en": " megawatts",
"nl": " megawatt"
it("should convert a value back and forth", () => {
const denomintion = new Denomination(
{
canonicalDenomination: "MW",
alternativeDenomination: ["megawatts", "megawatt"],
human: {
en: " megawatts",
nl: " megawatt",
},
}, "test");
},
"test"
)
const canonical = denomintion.canonicalValue("5", true)
expect(canonical).eq( "5 MW")
const units = new Unit(["key"], [denomintion], false)
const [detected, detectedDenom] = units.findDenomination("5 MW", () => "be")
expect(detected).eq( "5")
expect(detectedDenom).eq( denomintion)
}
)
const canonical = denomintion.canonicalValue("5", true)
expect(canonical).eq("5 MW")
const units = new Unit(["key"], [denomintion], false)
const [detected, detectedDenom] = units.findDenomination("5 MW", () => "be")
expect(detected).eq("5")
expect(detectedDenom).eq(denomintion)
})
})