[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:
Mofei Zhang
2023-03-13 14:49:53 -04:00
parent 814a21c97b
commit 03f3e541ce
538 changed files with 1 additions and 1 deletions
@@ -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