-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[code-infra] Changes for test util to work in vitest
#43625
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
Merged
Merged
Changes from 38 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
d69264c
Make createRenderer compliant with vitest
JCQuintas 31326f9
Make describeConformance compliant with vitest
JCQuintas 4db459c
Warning becomes too verbose
JCQuintas 456df29
global this
JCQuintas 76edd75
Fix chai matchers
JCQuintas 5bea067
Merge commit '2ad38e3044063e60bdad98618997233b27383001' into vitest-c…
JCQuintas 2a7343c
fix lint
JCQuintas c60515e
Fix mocha done
JCQuintas 63115f5
add mocha types
JCQuintas e7e755b
Replace tobeundefined with tobenull
JCQuintas 917dd25
separately export chai plugins
JCQuintas 41cbeea
Revert "Fix chai matchers"
JCQuintas 5fd0830
Merge commit 'dbc95b46cb0eff128872927aa3efcb9410fc46c6' into vitest-c…
JCQuintas 8157404
Use vitest internal fake timers
JCQuintas 0e74f56
only run useRealTimers if config
JCQuintas ae23bac
Invert running timers
JCQuintas bbd6fdd
Merge commit '94cc3d0a66456713e6e25edf9a1ba35ad8df88bc' into vitest-c…
JCQuintas ed66a3e
2284ad6
Merge commit 'e513ea36330c5222855130c8e3e6827901837f31' into vitest-c…
JCQuintas 0648e94
Merge commit 'be68b0913c61eae68175c0b8d79c1b032fa383e4' into vitest-c…
JCQuintas e9f9582
Some updates
Janpot 442770a
updates
Janpot 4e4cf78
tweaks
Janpot ba7fd91
Update ButtonBase.test.js
Janpot 9e8711c
fwfwr
Janpot e019f1a
Merge remote-tracking branch 'upstream/master' into pr/43625
Janpot d2b3f7f
tweaks
Janpot ccb3dd5
Update pnpm-lock.yaml
Janpot 9e3c284
remove troublesome deprecated queries
JCQuintas a105b2a
Browser tests
Janpot 39dc4f6
Update pnpm-lock.yaml
Janpot 7db34a1
Merge remote-tracking branch 'upstream/master' into pr/43625
Janpot 199bbef
Add describeSkipIf shim to test-utils
Janpot 73c5415
Fix sequence
Janpot 110d779
Update createRenderer.tsx
Janpot b67121a
Update setupVitest.ts
Janpot 92c2399
Merge commit 'e802a736705e54e337f6f4ac165022465c61cc8c' into vitest-c…
JCQuintas 6afd7c4
Expand tests
Janpot 6224e16
Create vitest.config.ts
Janpot 6e1c0a5
initMatchers
Janpot e512880
Update vitest.workspace.ts
Janpot d503f30
builder fixes
Janpot d4e0b02
wef
Janpot 6baab86
Update builder.test.mjs
Janpot b6ab66d
Merge remote-tracking branch 'upstream/master' into pr/43625
Janpot 7682b52
Update builder.test.mjs
Janpot eca4283
tests
Janpot f30b9a1
more tests
Janpot 370470d
fix typescript
Janpot 4eef12a
Merge remote-tracking branch 'upstream/master' into pr/43625
Janpot b955b6f
Merge commit '0ceedb8bc1f2f3bad9c6adf5a9d8f97a45a3c8b3' into vitest-c…
JCQuintas 9aafe1d
add vitestSetup export
JCQuintas ef00405
Revert test changes
JCQuintas 34e8231
deduped
JCQuintas dd8ee60
fix typescript
JCQuintas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages-internal/babel-plugin-minify-errors/vitest.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { mergeConfig, defineProject } from 'vitest/config'; | ||
import sharedConfig from '../../vitest.shared'; | ||
|
||
export default mergeConfig(sharedConfig, defineProject({})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { mergeConfig, defineProject } from 'vitest/config'; | ||
import sharedConfig from '../../vitest.shared'; | ||
|
||
export default mergeConfig(sharedConfig, defineProject({})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
export {}; | ||
|
||
// https://stackoverflow.com/a/46755166/3406963 | ||
declare global { | ||
namespace Chai { | ||
interface Assertion { | ||
/** | ||
* Checks `expectedStyle` is a subset of the elements inline style i.e. `element.style`. | ||
* @example expect(element).toHaveInlineStyle({ width: '200px' }) | ||
*/ | ||
toHaveInlineStyle( | ||
expectedStyle: Partial< | ||
Record< | ||
Exclude< | ||
keyof CSSStyleDeclaration, | ||
| 'getPropertyPriority' | ||
| 'getPropertyValue' | ||
| 'item' | ||
| 'removeProperty' | ||
| 'setProperty' | ||
| number | ||
>, | ||
string | ||
> | ||
>, | ||
): void; | ||
/** | ||
* Checks `expectedStyle` is a subset of the elements computed style i.e. `window.getComputedStyle(element)`. | ||
* @example expect(element).toHaveComputedStyle({ width: '200px' }) | ||
*/ | ||
toHaveComputedStyle( | ||
expectedStyle: Partial< | ||
Record< | ||
Exclude< | ||
keyof CSSStyleDeclaration, | ||
| 'getPropertyPriority' | ||
| 'getPropertyValue' | ||
| 'item' | ||
| 'removeProperty' | ||
| 'setProperty' | ||
| number | ||
>, | ||
string | ||
> | ||
>, | ||
): void; | ||
/** | ||
* Check if an element's [`visibility`](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility) is not `hidden` or `collapsed`. | ||
*/ | ||
toBeVisible(): void; | ||
/** | ||
* Check if an element's [`visibility`](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility) is `hidden` or `collapsed`. | ||
*/ | ||
toBeHidden(): void; | ||
/** | ||
* Checks if the element is inaccessible. | ||
* | ||
* Elements are considered inaccessible if they either: | ||
* - have [`visibility`](https://developer.mozilla.org/en-US/docs/Web/CSS/visibility) `hidden` | ||
* - have [`display`](https://developer.mozilla.org/en-US/docs/Web/CSS/display) `none` | ||
* - have `aria-hidden` `true` or any of their parents | ||
* | ||
* @see [Excluding Elements from the Accessibility Tree](https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion) | ||
*/ | ||
toBeInaccessible(): void; | ||
toHaveAccessibleDescription(description: string): void; | ||
/** | ||
* Checks if the accessible name computation (according to `accname` spec) | ||
* matches the expectation. | ||
* | ||
* @see https://www.w3.org/TR/accname-1.2/ | ||
* @param name | ||
*/ | ||
toHaveAccessibleName(name: string): void; | ||
/** | ||
* Checks if the element is actually focused i.e. `document.activeElement` is equal to the actual element. | ||
*/ | ||
toHaveFocus(): void; | ||
/** | ||
* Checks if the element is the active-descendant of the active element. | ||
*/ | ||
toHaveVirtualFocus(): void; | ||
/** | ||
* Matches calls to `console.warn` in the asserted callback. | ||
* | ||
* @example expect(() => render()).not.toWarnDev() | ||
* @example expect(() => render()).toWarnDev('single message') | ||
* @example expect(() => render()).toWarnDev(['first warning', 'then the second']) | ||
*/ | ||
toWarnDev(messages?: string | readonly (string | boolean)[]): void; | ||
/** | ||
* Matches calls to `console.error` in the asserted callback. | ||
* | ||
* @example expect(() => render()).not.toErrorDev() | ||
* @example expect(() => render()).toErrorDev('single message') | ||
* @example expect(() => render()).toErrorDev(['first warning', 'then the second']) | ||
*/ | ||
toErrorDev(messages?: string | readonly (string | boolean)[]): void; | ||
/** | ||
* Asserts that the given callback throws an error matching the given message in development (process.env.NODE_ENV !== 'production'). | ||
* In production it expects a minified error. | ||
*/ | ||
toThrowMinified(message: string): void; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.