From 422bf8fea5d297ae952ceffe595b848379b4fd01 Mon Sep 17 00:00:00 2001 From: Liam Rella Date: Mon, 12 Aug 2024 13:18:51 +0930 Subject: [PATCH] replace whitepsace tests --- .../__snapshots__/element.snap.twig | 15 ++++++++ .../__snapshots__/jsfmt.spec.js.snap | 34 ------------------- tests/Whitespace/jsfmt.spec.js | 15 +++++++- 3 files changed, 29 insertions(+), 35 deletions(-) create mode 100644 tests/Whitespace/__snapshots__/element.snap.twig delete mode 100644 tests/Whitespace/__snapshots__/jsfmt.spec.js.snap diff --git a/tests/Whitespace/__snapshots__/element.snap.twig b/tests/Whitespace/__snapshots__/element.snap.twig new file mode 100644 index 00000000..828ab2b0 --- /dev/null +++ b/tests/Whitespace/__snapshots__/element.snap.twig @@ -0,0 +1,15 @@ +
+ +
+ +

+ This is some text This is some text This is some text This is some text This + is some text This is some text This is some text This is some text This is + some text +

+ +
+ + {% include 'pages/formularios/sub/pregunta-simple.html' %} + {% set index = index + 1 %} +
diff --git a/tests/Whitespace/__snapshots__/jsfmt.spec.js.snap b/tests/Whitespace/__snapshots__/jsfmt.spec.js.snap deleted file mode 100644 index d1c77753..00000000 --- a/tests/Whitespace/__snapshots__/jsfmt.spec.js.snap +++ /dev/null @@ -1,34 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`element.twig - twig-verify > element.twig 1`] = ` -
- -
- -

- This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text This is some text -

- -
- - {% include 'pages/formularios/sub/pregunta-simple.html' %} - {% set index = index + 1 %} -
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
- -
- -

- This is some text This is some text This is some text This is some text This - is some text This is some text This is some text This is some text This is - some text -

- -
- - {% include 'pages/formularios/sub/pregunta-simple.html' %} - {% set index = index + 1 %} -
- -`; diff --git a/tests/Whitespace/jsfmt.spec.js b/tests/Whitespace/jsfmt.spec.js index 6b479d38..5bb80610 100644 --- a/tests/Whitespace/jsfmt.spec.js +++ b/tests/Whitespace/jsfmt.spec.js @@ -1 +1,14 @@ -run_spec(__dirname, ["twig"]); +import { run_spec } from "tests_config/run_spec"; +import { describe, expect, it } from "vitest"; + +/** @type {import('tests_config/run_spec').PrettierOptions} */ +const formatOptions = {}; + +describe("Whitespace", () => { + it("handle whitespace", async () => { + const { actual, snapshotFile } = await run_spec(import.meta.url, { + source: "element.twig" + }); + await expect(actual).toMatchFileSnapshot(snapshotFile); + }); +});