Update flow-parser to v0.317.0 (#19285)
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
1 parent
0edb3d8e44
commit
aa518b7cad
29 files changed
+3039
-12
No files matched your search
@@ -4,7 +4,7 @@ import { normalizeDirectory } from "./utilities.js";
|
||||
|
||||
const { __dirname } = createEsmUtils(import.meta);
|
||||
|
||||
export const FORMAT_SCRIPT_FILENAME = "format.test.js";
|
||||
export const FORMAT_TEST_SCRIPT_FILENAME = "format.test.js";
|
||||
|
||||
export const FORMAT_TEST_DIRECTORY = normalizeDirectory(
|
||||
path.join(__dirname, "../../format/"),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { FORMAT_SCRIPT_FILENAME } from "./constants.js";
|
||||
import { FORMAT_TEST_SCRIPT_FILENAME } from "./constants.js";
|
||||
import { verifyFilename } from "./verify-fixtures.js";
|
||||
import visualizeEndOfLine from "./visualize-end-of-line.js";
|
||||
|
||||
@@ -28,7 +28,7 @@ function* getFiles(context) {
|
||||
if (
|
||||
!file.isFile() ||
|
||||
filename[0] === "." ||
|
||||
filename === FORMAT_SCRIPT_FILENAME ||
|
||||
filename === FORMAT_TEST_SCRIPT_FILENAME ||
|
||||
// VSCode creates this file sometime https://github.com/microsoft/vscode/issues/105191
|
||||
filename === "debug.log" ||
|
||||
path.extname(filename) === ".snap"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import path from "node:path";
|
||||
import url from "node:url";
|
||||
import { FORMAT_SCRIPT_FILENAME } from "./constants.js";
|
||||
import { FORMAT_TEST_SCRIPT_FILENAME } from "./constants.js";
|
||||
import { getFixtures } from "./get-fixtures.js";
|
||||
import { getParsers } from "./get-parsers.js";
|
||||
import { testFixture } from "./run-test.js";
|
||||
@@ -41,9 +41,9 @@ function runFormatTest(rawFixtures, explicitParsers, rawOptions) {
|
||||
: { importMeta: rawFixtures };
|
||||
|
||||
const filename = path.basename(new URL(importMeta.url).pathname);
|
||||
if (filename !== FORMAT_SCRIPT_FILENAME) {
|
||||
if (filename !== FORMAT_TEST_SCRIPT_FILENAME) {
|
||||
throw new Error(
|
||||
`Format test should run in file named '${FORMAT_SCRIPT_FILENAME}'.`,
|
||||
`Format test should run in file named '${FORMAT_TEST_SCRIPT_FILENAME}'.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user