Skip to content

Commit 3de0cdf

Browse files
committed
updating tests based on prettier's changes
1 parent 0c1c5c3 commit 3de0cdf

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

tests/config/run-format-test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import fs from "node:fs";
22
import path from "node:path";
33
import url from "node:url";
4-
54
import createEsmUtils from "esm-utils";
6-
75
import getPrettier from "./get-prettier.js";
86
import getPlugins from "./get-plugins.js";
97
import compileContract from "./utils/compile-contract.js";
@@ -119,6 +117,12 @@ function runFormatTest(fixtures, parsers, options) {
119117
let { importMeta, snippets = [] } = fixtures.importMeta
120118
? fixtures
121119
: { importMeta: fixtures };
120+
121+
const filename = path.basename(new URL(importMeta.url).pathname);
122+
if (filename !== "format.test.js") {
123+
throw new Error(`Format test should run in file named 'format.test.js'.`);
124+
}
125+
122126
const dirname = path.dirname(url.fileURLToPath(importMeta.url));
123127

124128
// `IS_PARSER_INFERENCE_TESTS` mean to test `inferParser` on `standalone`

tests/config/utils/create-snapshot.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { wrap as raw } from "jest-snapshot-serializer-raw";
2-
32
import visualizeEndOfLine from "./visualize-end-of-line.js";
43
import visualizeRange from "./visualize-range.js";
54

0 commit comments

Comments
 (0)