/
githubmirror
/
ydb-embedded-ui
Обзор
Документация
Войти
/
githubmirror
/
ydb-embedded-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/utils/dataFormatters/__test__/roundToSignificant.test.ts
22 строки
929 B
Артём Муфазалов
test: replace it with test in jest tests (#1980)
24 фев 2025, 17:42
Не верифицирован
24 фев 2025, 17:42
cf9b3d1
Код
Авторство
О чём код?
import {roundToPrecision} from '../dataFormatters'; describe('roundToSignificant', () => { test('should work with only value', () => { expect(roundToPrecision(123)).toBe(123); expect(roundToPrecision(123.123)).toBe(123); expect(roundToPrecision(12.123)).toBe(12); expect(roundToPrecision(1.123)).toBe(1); expect(roundToPrecision(0.123)).toBe(0); expect(roundToPrecision(0)).toBe(0); }); test('should work with precision', () => { expect(roundToPrecision(123, 2)).toBe(123); expect(roundToPrecision(123.123, 2)).toBe(123); expect(roundToPrecision(12.123, 2)).toBe(12); expect(roundToPrecision(1.123, 2)).toBe(1.1); expect(roundToPrecision(0.123, 2)).toBe(0.12); expect(roundToPrecision(0.012, 2)).toBe(0.01); expect(roundToPrecision(0.001, 2)).toBe(0); expect(roundToPrecision(0, 2)).toBe(0); }); });