UNPKG

framer-motion

Version:

An open source and production-ready motion library for React on the web

14 lines (12 loc) • 552 B
import { isNumericalString } from "../is-numerical-string" describe("isNumericalString", () => { test("should correctly identify numerical strings", () => { expect(isNumericalString("10")).toBe(true) expect(isNumericalString("10.1")).toBe(true) expect(isNumericalString("-10.1")).toBe(true) expect(isNumericalString("10px")).toBe(false) expect(isNumericalString("10%")).toBe(false) expect(isNumericalString("10.1%")).toBe(false) expect(isNumericalString("rgb(0,0,0)")).toBe(false) }) })