Files
bitmappery/tests/unit/math/unit-math.spec.ts
2023-03-23 21:24:56 +01:00

15 lines
469 B
TypeScript

import { it, describe, expect } from "vitest";
import { fastRound } from "@/math/unit-math";
describe( "Unit math utilities", () => {
describe( "When rounding numbers", () => {
it( "should be able to round positive numbers", () => {
expect( fastRound( 13.67689767 )).toEqual( 14 );
});
it( "should be able to round negative numbers", () => {
expect( fastRound( -12.534523 )).toEqual( -12 );
});
});
});