Skip to content

Conversation

@jfeingold35
Copy link
Contributor

No description provided.

"@types/node": "^20.0.0",
"@types/semver": "^7.5.8",
"@types/tmp": "^0.2.6",
"fast-glob": "^3.3.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be a dependency if it is only used in test. It should be a devDepenency at best. But is there an alternative instead of adding more dependencies to our project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I was positive I had it as a devDependency already. Guess not.
I'll see if there's an alternative, but the problem is that the logfile's name is randomly generated, so we don't already know where it is.
I'll see what the other options are to programmatically find a file.

Comment on lines 61 to 63
it('Generates no log file', async () => {
const flowLogFiles = await fg.glob('./**/.flowtest_log_*.log');
expect(flowLogFiles).toHaveLength(0);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems heavy handed to pull in all of fast-glob just too look up if a .log file was generated somewhere underneath the current working directory. I wonder if there is some other node built in tool that we could use instead. If not then I wonder if the test is even needed or worth it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is worth it IMO because it locks in the behavior of not generating the log file.

Comment on lines +59 to +63
it('Generates no log file', async () => {
const logFileMatcher = /\.flowtest_log_.+\.log/;
const logFiles = (await fs.readdir('.')).filter(f => f.match(logFileMatcher));
expect(logFiles).toHaveLength(0);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now. Thanks for removing the glob dependency.

@jfeingold35 jfeingold35 marked this pull request as ready for review November 27, 2024 16:22
@jfeingold35 jfeingold35 merged commit f8f4f3b into dev Nov 27, 2024
5 checks passed
@stephen-carter-at-sf stephen-carter-at-sf deleted the d/W-17311830 branch December 20, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants