Skip to content

Commit

Permalink
feat: Add unit tests to getDomainPriceFromName
Browse files Browse the repository at this point in the history
  • Loading branch information
letehaha committed Dec 5, 2023
1 parent bc85d77 commit ceab386
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions js/tests/get-domain-price-from-name.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require("dotenv").config();
import { describe, test, expect } from "@jest/globals";
import { getDomainPriceFromName } from "../src/utils";

describe("getDomainPriceFromName", () => {
test.each([
['1', 750],
['✅', 750],
['요', 750],
['👩‍👩‍👧', 750],

['10', 700],
['1✅', 700],
['👩‍👩‍👧✅', 700],
['독도', 700],

['100', 640],
['10✅', 640],
['1독도', 640],

['1000', 160],
['100✅', 160],

['10000', 20],
['1000✅', 20],
['fêtes', 20],
])('value %s to be %s', (value, expected) => {
expect(getDomainPriceFromName(value)).toBe(expected);
})
});

0 comments on commit ceab386

Please sign in to comment.