|
1 | 1 | import { addTypeSpecificValues, translateJSON } from "$lib/text/nbt_or_json"; |
2 | | -import type { MinecraftText, TranslateOptions } from "$lib/types"; |
| 2 | +import { versions, type MinecraftText, type TranslateOptions } from "$lib/types"; |
3 | 3 | import type { JSONContent } from "@tiptap/core"; |
4 | 4 | import { describe, expect, it } from "vitest"; |
5 | 5 | import { readTestDataFile, readTestJSONFile } from "./test_utils"; |
| 6 | +import { outputVersion } from "$lib/stores"; |
6 | 7 |
|
7 | 8 | describe("translate", () => { |
8 | 9 | it("should return a basic string", () => { |
@@ -32,7 +33,6 @@ describe("translate", () => { |
32 | 33 |
|
33 | 34 | const baseOptions: TranslateOptions = { |
34 | 35 | exportType: "standard", |
35 | | - exportVersion: "new", |
36 | 36 | optimise: false, |
37 | 37 | indent: false, |
38 | 38 | indentSize: 2, |
@@ -146,9 +146,9 @@ describe("translate", () => { |
146 | 146 | const json: JSONContent = (await readTestJSONFile( |
147 | 147 | "clean/json/interactives_tiptap.json", |
148 | 148 | )) as JSONContent; |
| 149 | + outputVersion.set(versions[0]) |
149 | 150 | const result = translateJSON(json, { |
150 | 151 | ...baseOptions, |
151 | | - exportVersion: "old", |
152 | 152 | }); |
153 | 153 | expect(JSON.parse(result)).toHaveProperty("[1].clickEvent"); |
154 | 154 | expect(JSON.parse(result)).not.toHaveProperty("[1].click_event"); |
|
0 commit comments