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

react-conformance: find a way to have typed "testOptions" with "extraTests" #19618

Closed
layershifter opened this issue Sep 2, 2021 · 5 comments
Assignees

Comments

@layershifter
Copy link
Member

layershifter commented Sep 2, 2021

#19500 introduced new test conformance test, but it's used as extra test:

isConformant({
    extraTests: makeStylesTests,
})

This works nice, but there is a small problem. The test has custom options (callCount) and they cannot be specified (produces TS error) as they no way to extend TestOption type:

export interface TestOptions {
'consistent-callback-names'?: {
ignoreProps?: string[];
};
}

@layershifter
Copy link
Member Author

FYI @ecraig12345

@ecraig12345
Copy link
Member

@layershifter Good catch, do you have ideas for how to extend this, or a different approach?

@msft-fluent-ui-bot
Copy link
Collaborator

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Feb 4, 2022
@layershifter layershifter reopened this Feb 4, 2022
@ecraig12345 ecraig12345 removed the Resolution: Soft Close Soft closing inactive issues over a certain period label Feb 5, 2022
@ecraig12345
Copy link
Member

ecraig12345 commented Feb 5, 2022

Per @layershifter's suggestion I'm planning on changing the isConformant API to be more like babel's API:

isConformant({
  componentPath: '',
  presets: [ // or "rules"
    basePreset({ /* strictly typed config options */ }),
    griffelPreset(),
  ],
});

Each preset will also support an exclude option for disabling rules.

@ecraig12345
Copy link
Member

Tracked by #21665 instead.

@microsoft microsoft locked as resolved and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants