diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index dba2c89..4354e02 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -7,10 +7,13 @@ jobs:
ci:
runs-on: ubuntu-latest
steps:
- - name: Checkout
- uses: actions/checkout@v4
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
- sparse-checkout: src
+ node-version: "20.18.0"
+
+ - name: Dependencies
+ run: yarn install --frozen-lockfile
- name: Setup Biome CLI
uses: biomejs/setup-biome@v2
@@ -19,3 +22,6 @@ jobs:
- name: Run Biome
run: biome ci .
+
+ - name: Run Tests
+ run: yarn test
diff --git a/__test__/unit/__snapshots__/svg2jsx.test.ts.snap b/__test__/unit/__snapshots__/svg2jsx.test.ts.snap
new file mode 100644
index 0000000..5eb1117
--- /dev/null
+++ b/__test__/unit/__snapshots__/svg2jsx.test.ts.snap
@@ -0,0 +1,19 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`svg2jsx tests clean attributes 1`] = `""`;
+
+exports[`svg2jsx tests convert attributes 1`] = `""`;
+
+exports[`svg2jsx tests convert inline styles to style objects 1`] = `""`;
+
+exports[`svg2jsx tests convert nested nodes 1`] = `""`;
+
+exports[`svg2jsx tests convert text elements 1`] = `""`;
+
+exports[`svg2jsx tests keep attribute values 1`] = `""`;
+
+exports[`svg2jsx tests keep dimensions attributes 1`] = `""`;
+
+exports[`svg2jsx tests quote string style values 1`] = `""`;
+
+exports[`svg2jsx tests remove unnecessary nodes 1`] = `""`;
diff --git a/__test__/unit/svg2jsx.test.ts b/__test__/unit/svg2jsx.test.ts
new file mode 100644
index 0000000..482cdf4
--- /dev/null
+++ b/__test__/unit/svg2jsx.test.ts
@@ -0,0 +1,111 @@
+import { describe, expect, test } from "@jest/globals";
+
+import { svg2jsx } from "../../src/pages/api";
+
+describe("svg2jsx tests", () => {
+ test("clean attributes", () => {
+ const jsx = svg2jsx('', {});
+
+ expect(jsx).toEqual(expect.not.stringMatching(/strok/));
+ expect(jsx).toMatchSnapshot();
+ });
+
+ test("remove unnecessary nodes", () => {
+ const jsx = svg2jsx("", {});
+
+ expect(jsx).toEqual(expect.stringMatching(/