|
1 | 1 | import { describe, it } from "node:test" |
2 | 2 | import assert from "node:assert/strict" |
3 | | -import { truncate, extractTextFromParts } from "../src/index" |
| 3 | +import { truncate, extractTextFromParts, PLUGIN_VERSION } from "../src/index" |
4 | 4 | import { buildPayload } from "../src/payload" |
5 | 5 |
|
6 | 6 | describe("truncate", () => { |
@@ -64,11 +64,12 @@ describe("extractTextFromParts", () => { |
64 | 64 | }) |
65 | 65 |
|
66 | 66 | describe("PLUGIN_VERSION", () => { |
67 | | - it("resolves to a valid semver string from package.json", async () => { |
68 | | - const pkg = await import("../package.json", { with: { type: "json" } }) |
69 | | - const version = pkg.default.version |
70 | | - assert.ok(typeof version === "string", "version should be a string") |
71 | | - assert.match(version, /^\d+\.\d+\.\d+/, "version should be semver") |
| 67 | + it("resolves to a valid semver string from package.json", () => { |
| 68 | + assert.ok( |
| 69 | + typeof PLUGIN_VERSION === "string", |
| 70 | + "PLUGIN_VERSION should be a string", |
| 71 | + ) |
| 72 | + assert.match(PLUGIN_VERSION, /^\d+\.\d+\.\d+/, "version should be semver") |
72 | 73 | }) |
73 | 74 | }) |
74 | 75 |
|
|
0 commit comments