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 TS ExpectType in CI #2968

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Dec 19, 2023

Improves #2956 testing.

TBH, I do not know what the issue is and how to debug/fix it.

@mvorisek mvorisek force-pushed the ts_expect_type_ci branch 3 times, most recently from 7de30f2 to 29c2ec8 Compare December 19, 2023 13:35
@mvorisek
Copy link
Contributor Author

@JoshuaKGoldberg do you have an idea why the $ExpectType are resolved to any?

CI:

/home/runner/work/Fomantic-UI/Fomantic-UI/types/tests.ts
Error:     3:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:     4:1  error  Expected type to be: JQuery, got: any               expect-type/expect
Error:     5:1  error  Expected type to be: JQuery<JQuery>, got: any       expect-type/expect
Error:     6:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:     7:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:     8:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:     9:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    10:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    11:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    12:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    13:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    14:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    15:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    16:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    17:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    18:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    19:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    20:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    21:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    22:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    23:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    24:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    25:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    40:1  error  Can not match a node to this assertion              expect-type/expect
Error:    42:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    43:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:    44:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect
Error:   115:1  error  Can not match a node to this assertion              expect-type/expect
Error:   123:1  error  Can not match a node to this assertion              expect-type/expect
Error:   154:1  error  Can not match a node to this assertion              expect-type/expect
Error:   156:1  error  Expected type to be: JQuery<HTMLElement>, got: any  expect-type/expect

@JoshuaKGoldberg
Copy link

No clue, I've never seen this repository before 😄.

@mvorisek
Copy link
Contributor Author

mvorisek commented Apr 2, 2024

Hi @prudho, in #2822, more precisely in https://github.com/prudho/Fomantic-UI/blob/1acdce3d8a4e3c5684a46192a1d8dd823d0c8aa4/types/fomantic-ui-tests.ts you have added a test with expected types. Might I know if you ever run this test, and if yes, what package did you use and how to test it using CI?

@prudho
Copy link
Contributor

prudho commented Apr 8, 2024

Hi @mvorisek ! This file was required as a condition for the type definition to be published to the DefinitelyTyped repo. They seem to need it to run only a simple type check when validating the definitions, using dtslint (see https://github.com/Microsoft/DefinitelyTyped-tools/tree/main/packages/dtslint#write-tests). TBH this file was more a stub than a real test file when I "wrote" it (copy from another definition type lib), for a real CI I think that tests should be way more expanded.

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