-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
refactor(tests): ensure test files have the .test.ts extension
#11801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f8fab92 to
46de81b
Compare
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to acedb7d
Previous suggestionsSuggestions up to commit 30bf024
Suggestions up to commit 46de81b
|
|||||||||||||||||||||||||||||
| @@ -10,7 +10,8 @@ import { ViewA } from "./entity/ViewA" | |||
| import { ViewB } from "./entity/ViewB" | |||
| import { TestEntity } from "./entity/Test" | |||
|
|
|||
| describe("views dependencies", () => { | |||
| // TODO: Implement topological sorting for view dependencies https://github.com/typeorm/typeorm/issues/8240 | |||
| describe.skip("views dependencies", () => { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed this test started to fail after this change, and for very good reason: this feature was not implemented correctly.
Since the purpose of this PR is to simply fix the file names, I will leave the feature to be fixed separately.
OSA413
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you use some tool to rename the files?
| @@ -1,10 +1,10 @@ | |||
| { | |||
| "__comment": "TODO: remove --exit flag: https://mochajs.org/#-exit", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to document the current use of the exit flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, we could change the file format to jsonc for comments, but then we'd have to adjust the lintstaged config to handle that too.
Maybe the comment is not really needed, and since we were anyway discussing to move to something else (vitest was one of the proposal), probably this file won't exist for too long.
I was hoping the json schema for mocha has documentation (it doesn't), but honestly, seeing the commit message from your PR was more helpful why we added the option than the documentation/comment.
|
Yes, I noticed some files are named Will change If we pick the BDD style (or not), we could also ask for new tests to be in the Given-When-Then (aka Arrange-Act-Assert). Existing tests don't necessarily follow the format. |
30bf024 to
95e668f
Compare
PR Code Suggestions ✨No code suggestions found for the PR. |
gioboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great 👍
95e668f to
acedb7d
Compare
acedb7d to
55dbffb
Compare
PR Code Suggestions ✨No code suggestions found for the PR. |
Description of change
Enforce all test files to have the
.test.tsextension, so that they are better separated from other files in thetestfolder. This will allow our test runner (currentlymocha) to search for less files. This is also a prerequisite to replacingmochawith e.g.vitestin the future, as other test runners will complain about test files that don't contain tests.I will update the PR if we decide for
.spec.tsinstead of.test.ts. Please check the poll in our technical discussion channel.Pull-Request Checklist
masterbranchFixes #00000