Skip to content
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

test: allow to execute tests on windows #6488

Merged
merged 3 commits into from Feb 18, 2023
Merged

Conversation

armano2
Copy link
Member

@armano2 armano2 commented Feb 18, 2023

Partially fix running tests on windows machines, with this change most tests do pass with exception to

expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(`
{
"invalid": [
{
"code": "invalid tests should work as well",
"errors": [],
"filename": "/some/path/that/totally/exists/file.ts",
},
],
"valid": [
{
"code": "string based valid test",
"filename": "/some/path/that/totally/exists/file.ts",
},
{
"code": "object based valid test",
"filename": "/some/path/that/totally/exists/file.ts",
},
{
"code": "explicit filename shouldn't be overwritten",
"filename": "/set/in/the/test.ts",
},
{
"code": "jsx should have the correct filename",
"filename": "/some/path/that/totally/exists/file.tsx",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
},
},
},
{
"code": "type-aware parser options should override the constructor config",
"filename": "/set/in/the/test/file.ts",
"parserOptions": {
"project": "tsconfig.test-specific.json",
"tsconfigRootDir": "/set/in/the/test/",
},
},
],
}
`);
});

filename is not correctly normalized in this test, this can be fixed after updating jest to 29.4 with EqualityTesters - https://jestjs.io/docs/expect#expectaddequalitytesterstesters

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @armano2!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Feb 18, 2023

Deploy Preview for typescript-eslint failed.

Name Link
🔨 Latest commit 14cce83
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/63f0c02f0477f00008f841dc

@armano2 armano2 changed the base branch from main to v6 February 18, 2023 12:10
@armano2 armano2 changed the title fix/tests on windows test: allow to execute tests on windows Feb 18, 2023
@codecov
Copy link

codecov bot commented Feb 18, 2023

Codecov Report

Merging #6488 (3052b2c) into v6 (c1368f2) will increase coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##               v6    #6488      +/-   ##
==========================================
+ Coverage   87.11%   87.12%   +0.01%     
==========================================
  Files         361      362       +1     
  Lines       12417    12474      +57     
  Branches     3675     3688      +13     
==========================================
+ Hits        10817    10868      +51     
- Misses       1253     1260       +7     
+ Partials      347      346       -1     
Flag Coverage Δ
unittest 87.12% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/typescript-estree/src/convert.ts 28.68% <0.00%> (-0.03%) ⬇️
packages/eslint-plugin/src/rules/semi.ts 100.00% <0.00%> (ø)
packages/eslint-plugin/src/rules/indent.ts 92.85% <0.00%> (ø)
packages/eslint-plugin/src/rules/quotes.ts 94.11% <0.00%> (ø)
packages/eslint-plugin/src/rules/typedef.ts 96.00% <0.00%> (ø)
packages/type-utils/src/getContextualType.ts 0.00% <0.00%> (ø)
packages/eslint-plugin/src/rules/no-shadow.ts 77.65% <0.00%> (ø)
packages/eslint-plugin/src/rules/brace-style.ts 95.34% <0.00%> (ø)
packages/eslint-plugin/src/rules/key-spacing.ts 99.30% <0.00%> (ø)
packages/eslint-plugin/src/rules/comma-dangle.ts 93.33% <0.00%> (ø)
... and 56 more

@@ -1,2 +0,0 @@
type A = typeof import('A');
type B = import('B').X<Y>;
Copy link
Member Author

Choose a reason for hiding this comment

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

shared-fixtures has been removed in v6 and test is already correctly migrated, this is most leftover from merge conflict

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

As a former Windows user, I very much appreciate you sending this in 😄 thanks!

Filed #6490 too.

@JoshuaKGoldberg JoshuaKGoldberg merged commit ff6b190 into v6 Feb 18, 2023
@JoshuaKGoldberg JoshuaKGoldberg deleted the fix/tests-on-windows branch February 18, 2023 22:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants