Add starter kit to user tests#19934
Conversation
If there is a test.json in the directory, it expects to find a submodule in the directory. The submodule should have the same name as the directory itself. test.json contains a list of global types that need to be available, or the empty list if none.
|
I did not baseline React, React-Native or WeChat, even though they currently fail, because I have a simple change to tsconfig for each.
Even if we need to fully upgrade each repo to the latest versions of their respective libraries, I think we can do that instead fairly quickly. |
| if (update.status !== 0) throw new Error(`git submodule update for ${directoryName} failed!`); | ||
|
|
||
| const config = JSON.parse(fs.readFileSync(path.join(cwd, "test.json"), { encoding: "utf8" })) as UserConfig; | ||
| ts.Debug.assert(!!config.types, "Git is the only reason for using test.json right now"); |
There was a problem hiding this comment.
"Git is the only reason for using test.json right now"? That's not what's being checked here, so it's odd. I think "Types field must be present" would be sufficient. And likely not need to change in the future.
weswigham
left a comment
There was a problem hiding this comment.
Seems good.
Inconsequential question:
The tests update the submodules regularly, which is good; do we want a bot to commit those updated submodules when they change without consequence to the baselines? I think they'll show up in git status (not sure) each time they're changed, if that affects your response.
|
That's an interesting question that we should discuss in person. I'm not sure which you are suggesting:
(1) seems more desirable to me, and easier to write, since (I guess) it's just an additional call to |
Add starter kit repos to user tests. This works by looking for a
test.jsonfile in the test directory. If one is present, then the runner updates submodules, the changes the working directory to the submodule's subdirectory.The
typesfield fromtest.jsonis used to prevent errors from compiling inside of the Typescript project. And the--noEmitflag is added to everything to allow empty--typesto work, in addition to speeding up test times.