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: Format codebase with prettier #959

Merged
merged 3 commits into from
Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
with:
useLockFile: false

# TODO: Can be removed if https://github.com/kentcdodds/kcd-scripts/pull/146 is released
- name: Verify format (`npm run format` committed?)
run: npm run format -- --check --no-write

# as requested by the React team :)
# https://reactjs.org/blog/2019/10/22/react-release-channels.html#using-the-next-channel-for-integration-testing
- name: ⚛️ Setup react
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"build:bundle:main": "dotenv -e .bundle.main.env kcd-scripts build -- --bundle --no-clean",
"build:bundle:pure": "dotenv -e .bundle.main.env -e .bundle.pure.env kcd-scripts build -- --bundle --no-clean",
"build:main": "kcd-scripts build --no-clean",
"format": "kcd-scripts format",
"lint": "kcd-scripts lint",
"setup": "npm install && npm run validate -s",
"test": "kcd-scripts test",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {cleanup} from './pure'
// this ensures that tests run in isolation from each other
// if you don't like this then either import the `pure` module
// or set the RTL_SKIP_AUTO_CLEANUP env variable to 'true'.
if (typeof process === "undefined" || !process.env?.RTL_SKIP_AUTO_CLEANUP) {
if (typeof process === 'undefined' || !process.env?.RTL_SKIP_AUTO_CLEANUP) {
// ignore teardown() in code coverage because Jest does not support it
/* istanbul ignore else */
if (typeof afterEach === 'function') {
Expand Down
6 changes: 3 additions & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export * from '@testing-library/dom'

export type RenderResult<
Q extends Queries = typeof queries,
Container extends Element | DocumentFragment = HTMLElement
Container extends Element | DocumentFragment = HTMLElement,
> = {
container: Container
baseElement: Element
Expand All @@ -32,7 +32,7 @@ export type RenderResult<

export interface RenderOptions<
Q extends Queries = typeof queries,
Container extends Element | DocumentFragment = HTMLElement
Container extends Element | DocumentFragment = HTMLElement,
> {
container?: Container
baseElement?: Element
Expand All @@ -48,7 +48,7 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
*/
export function render<
Q extends Queries = typeof queries,
Container extends Element | DocumentFragment = HTMLElement
Container extends Element | DocumentFragment = HTMLElement,
>(
ui: React.ReactElement,
options: RenderOptions<Q, Container>,
Expand Down