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

refac: refactoring setup.ts #1166

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ssi02014
Copy link

What:

Refactoring setup.ts

Why:

I reused existing declared types and unified the argument order of the functions.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

@ssi02014 ssi02014 changed the title refac: refactoring typing refac: refactoring setup.ts Sep 17, 2023
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4689738:

Sandbox Source
userEvent-dom Configuration
userEvent-react Configuration

@@ -18,7 +18,7 @@ import {DirectOptions} from './directApi'
/**
* Default options applied when API is called per `userEvent.anyApi()`
*/
const defaultOptionsDirect: Required<Options> = {
const defaultOptionsDirect: Config = {
Copy link
Author

Choose a reason for hiding this comment

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

I changed it to the existing defined Config.

export type Config = Required<Options>

node: Node | undefined,
defaults: Required<Options>,
) {
function getDocument(options: Options, defaults: Config, node?: Node) {
Copy link
Author

@ssi02014 ssi02014 Sep 17, 2023

Choose a reason for hiding this comment

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

createConfig and getDocument seem to take the same arguments, so I unified the order in which they take them. What do you think?

@ssi02014
Copy link
Author

@kentcdodds 👋
I would appreciate it if you could take a look at that pull request!

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.

1 participant