mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[tests][hir-typer] Add hir-tests fixture
--- Currently, we run type inference passes early in the pipeline and do not check inference output in any tests, test fixtures, or verifier passes. In fact, the only ways to view inferred types are (1) locally add a test fixture with`@only` and inspect console logs or (2) scroll to the relevant section on a playground example. However, inferred types and effects significantly affect the output of later passes (Alias / MutableRange analysis, InferReactiveIdentifiers, etc), and we have already found some bugs due to incorrect inference (e.g. #1274). This PR add the `typer-tests` fixture with the following goals 1. Record relevant current compiler type + effect inference output. 2. Have relatively stable output (with respect to changes in HIR and PrintHIR). - we try to achieve this by annotating the source code.
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ const FlowPragmas = [/\/\/\s@flow$/gm, /\*\s@flow$/gm];
|
||||
|
||||
describe("React Forget (HIR version)", () => {
|
||||
generateTestsFromFixtures(
|
||||
path.join(__dirname, "fixtures", "hir"),
|
||||
path.join(__dirname, "fixtures", "compiler"),
|
||||
(input, file, options) => {
|
||||
const matches = input.matchAll(Pragma_RE);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user