Skip to content
Open
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
3 changes: 3 additions & 0 deletions types/__tests__/bun/bun-custom-expect-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ customExpect(element).toContainHTML('body')
customExpect(element).toHaveAttribute('attr')
customExpect(element).toHaveAttribute('attr', true)
customExpect(element).toHaveAttribute('attr', 'yes')
customExpect(element).toHaveAttribute('attr', expect.stringContaining('yes'))
customExpect(element).toHaveClass()
customExpect(element).toHaveClass('cls1')
customExpect(element).toHaveClass('cls1', 'cls2', 'cls3', 'cls4')
Expand All @@ -48,8 +49,10 @@ customExpect(element).toHaveDisplayValue(/str/)
customExpect(element).toHaveDisplayValue([/str1/, 'str2'])
customExpect(element).toHaveFocus()
customExpect(element).toHaveFormValues({foo: 'bar', baz: 1})
customExpect(element).toHaveFormValues({foo: 'bar', baz: expect.any(Number)})
customExpect(element).toHaveStyle('display: block')
customExpect(element).toHaveStyle({display: 'block', width: 100})
customExpect(element).toHaveStyle({display: expect.any(String)})
customExpect(element).toHaveTextContent('Text')
customExpect(element).toHaveTextContent(/Text/)
customExpect(element).toHaveTextContent('Text', {normalizeWhitespace: true})
Expand Down
3 changes: 3 additions & 0 deletions types/__tests__/bun/bun-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ expect(element).toContainHTML('body')
expect(element).toHaveAttribute('attr')
expect(element).toHaveAttribute('attr', true)
expect(element).toHaveAttribute('attr', 'yes')
expect(element).toHaveAttribute('attr', expect.stringContaining('yes'))
expect(element).toHaveClass()
expect(element).toHaveClass('cls1')
expect(element).toHaveClass('cls1', 'cls2', 'cls3', 'cls4')
Expand All @@ -37,8 +38,10 @@ expect(element).toHaveDisplayValue(/str/)
expect(element).toHaveDisplayValue([/str1/, 'str2'])
expect(element).toHaveFocus()
expect(element).toHaveFormValues({foo: 'bar', baz: 1})
expect(element).toHaveFormValues({foo: 'bar', baz: expect.any(Number)})
expect(element).toHaveStyle('display: block')
expect(element).toHaveStyle({display: 'block', width: 100})
expect(element).toHaveStyle({display: expect.any(String)})
expect(element).toHaveTextContent('Text')
expect(element).toHaveTextContent(/Text/)
expect(element).toHaveTextContent('Text', {normalizeWhitespace: true})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ customExpect(element).toContainHTML('body')
customExpect(element).toHaveAttribute('attr')
customExpect(element).toHaveAttribute('attr', true)
customExpect(element).toHaveAttribute('attr', 'yes')
customExpect(element).toHaveAttribute('attr', expect.stringContaining('yes'))
customExpect(element).toHaveClass()
customExpect(element).toHaveClass('cls1')
customExpect(element).toHaveClass('cls1', 'cls2', 'cls3', 'cls4')
Expand All @@ -47,8 +48,10 @@ customExpect(element).toHaveDisplayValue(/str/)
customExpect(element).toHaveDisplayValue([/str1/, 'str2'])
customExpect(element).toHaveFocus()
customExpect(element).toHaveFormValues({foo: 'bar', baz: 1})
customExpect(element).toHaveFormValues({foo: 'bar', baz: expect.any(Number)})
customExpect(element).toHaveStyle('display: block')
customExpect(element).toHaveStyle({display: 'block', width: 100})
customExpect(element).toHaveStyle({display: expect.any(String)})
customExpect(element).toHaveTextContent('Text')
customExpect(element).toHaveTextContent(/Text/)
customExpect(element).toHaveTextContent('Text', {normalizeWhitespace: true})
Expand Down
3 changes: 3 additions & 0 deletions types/__tests__/jest-globals/jest-globals-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ expect(element).toContainHTML('body')
expect(element).toHaveAttribute('attr')
expect(element).toHaveAttribute('attr', true)
expect(element).toHaveAttribute('attr', 'yes')
expect(element).toHaveAttribute('attr', expect.stringContaining('yes'))
expect(element).toHaveClass()
expect(element).toHaveClass('cls1')
expect(element).toHaveClass('cls1', 'cls2', 'cls3', 'cls4')
Expand All @@ -37,8 +38,10 @@ expect(element).toHaveDisplayValue(/str/)
expect(element).toHaveDisplayValue([/str1/, 'str2'])
expect(element).toHaveFocus()
expect(element).toHaveFormValues({foo: 'bar', baz: 1})
expect(element).toHaveFormValues({foo: 'bar', baz: expect.any(Number)})
expect(element).toHaveStyle('display: block')
expect(element).toHaveStyle({display: 'block', width: 100})
expect(element).toHaveStyle({display: expect.any(String)})
expect(element).toHaveTextContent('Text')
expect(element).toHaveTextContent(/Text/)
expect(element).toHaveTextContent('Text', {normalizeWhitespace: true})
Expand Down
3 changes: 3 additions & 0 deletions types/__tests__/jest/jest-custom-expect-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ customExpect(element).toContainHTML('body')
customExpect(element).toHaveAttribute('attr')
customExpect(element).toHaveAttribute('attr', true)
customExpect(element).toHaveAttribute('attr', 'yes')
customExpect(element).toHaveAttribute('attr', expect.stringContaining('yes'))
customExpect(element).toHaveClass()
customExpect(element).toHaveClass('cls1')
customExpect(element).toHaveClass(/cls/)
Expand All @@ -47,8 +48,10 @@ customExpect(element).toHaveDisplayValue(/str/)
customExpect(element).toHaveDisplayValue([/str1/, 'str2'])
customExpect(element).toHaveFocus()
customExpect(element).toHaveFormValues({foo: 'bar', baz: 1})
customExpect(element).toHaveFormValues({foo: 'bar', baz: expect.any(Number)})
customExpect(element).toHaveStyle('display: block')
customExpect(element).toHaveStyle({display: 'block', width: 100})
customExpect(element).toHaveStyle({display: expect.any(String)})
customExpect(element).toHaveTextContent('Text')
customExpect(element).toHaveTextContent(/Text/)
customExpect(element).toHaveTextContent('Text', {normalizeWhitespace: true})
Expand Down
3 changes: 3 additions & 0 deletions types/__tests__/jest/jest-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ expect(element).toContainHTML('body')
expect(element).toHaveAttribute('attr')
expect(element).toHaveAttribute('attr', true)
expect(element).toHaveAttribute('attr', 'yes')
expect(element).toHaveAttribute('attr', expect.stringContaining('yes'))
expect(element).toHaveClass()
expect(element).toHaveClass('cls1')
expect(element).toHaveClass('cls1', 'cls2', 'cls3', 'cls4')
Expand All @@ -36,8 +37,10 @@ expect(element).toHaveDisplayValue(/str/)
expect(element).toHaveDisplayValue([/str1/, 'str2'])
expect(element).toHaveFocus()
expect(element).toHaveFormValues({foo: 'bar', baz: 1})
expect(element).toHaveFormValues({foo: 'bar', baz: expect.any(Number)})
expect(element).toHaveStyle('display: block')
expect(element).toHaveStyle({display: 'block', width: 100})
expect(element).toHaveStyle({display: expect.any(String)})
expect(element).toHaveTextContent('Text')
expect(element).toHaveTextContent(/Text/)
expect(element).toHaveTextContent('Text', {normalizeWhitespace: true})
Expand Down
3 changes: 3 additions & 0 deletions types/__tests__/vitest/vitest-custom-expect-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ customExpect(element).toContainHTML('body')
customExpect(element).toHaveAttribute('attr')
customExpect(element).toHaveAttribute('attr', true)
customExpect(element).toHaveAttribute('attr', 'yes')
customExpect(element).toHaveAttribute('attr', expect.stringContaining('yes'))
customExpect(element).toHaveClass()
customExpect(element).toHaveClass('cls1')
customExpect(element).toHaveClass('cls1', 'cls2', 'cls3', 'cls4')
Expand All @@ -47,8 +48,10 @@ customExpect(element).toHaveDisplayValue(/str/)
customExpect(element).toHaveDisplayValue([/str1/, 'str2'])
customExpect(element).toHaveFocus()
customExpect(element).toHaveFormValues({foo: 'bar', baz: 1})
customExpect(element).toHaveFormValues({foo: 'bar', baz: expect.any(Number)})
customExpect(element).toHaveStyle('display: block')
customExpect(element).toHaveStyle({display: 'block', width: 100})
customExpect(element).toHaveStyle({display: expect.any(String)})
customExpect(element).toHaveTextContent('Text')
customExpect(element).toHaveTextContent(/Text/)
customExpect(element).toHaveTextContent('Text', {normalizeWhitespace: true})
Expand Down
3 changes: 3 additions & 0 deletions types/__tests__/vitest/vitest-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ expect(element).toContainHTML('body')
expect(element).toHaveAttribute('attr')
expect(element).toHaveAttribute('attr', true)
expect(element).toHaveAttribute('attr', 'yes')
expect(element).toHaveAttribute('attr', expect.stringContaining('yes'))
expect(element).toHaveClass()
expect(element).toHaveClass('cls1')
expect(element).toHaveClass('cls1', 'cls2', 'cls3', 'cls4')
Expand All @@ -37,8 +38,10 @@ expect(element).toHaveDisplayValue(/str/)
expect(element).toHaveDisplayValue([/str1/, 'str2'])
expect(element).toHaveFocus()
expect(element).toHaveFormValues({foo: 'bar', baz: 1})
expect(element).toHaveFormValues({foo: 'bar', baz: expect.any(Number)})
expect(element).toHaveStyle('display: block')
expect(element).toHaveStyle({display: 'block', width: 100})
expect(element).toHaveStyle({display: expect.any(String)})
expect(element).toHaveTextContent('Text')
expect(element).toHaveTextContent(/Text/)
expect(element).toHaveTextContent('Text', {normalizeWhitespace: true})
Expand Down
6 changes: 3 additions & 3 deletions types/matchers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ declare namespace matchers {
* @see
* [testing-library/jest-dom#tohaveattribute](https://github.com/testing-library/jest-dom#tohaveattribute)
*/
toHaveAttribute(attr: string, value?: unknown): R
toHaveAttribute(attr: string, value?: any): R
/**
* @description
* Check whether the given element has certain classes within its `class` attribute.
Expand Down Expand Up @@ -339,7 +339,7 @@ declare namespace matchers {
* @see
* [testing-library/jest-dom#tohaveformvalues](https://github.com/testing-library/jest-dom#tohaveformvalues)
*/
toHaveFormValues(expectedValues: Record<string, unknown>): R
toHaveFormValues(expectedValues: Record<string, any>): R
/**
* @description
* Check if an element has specific css properties with specific values applied.
Expand All @@ -362,7 +362,7 @@ declare namespace matchers {
* @see
* [testing-library/jest-dom#tohavestyle](https://github.com/testing-library/jest-dom#tohavestyle)
*/
toHaveStyle(css: string | Record<string, unknown>): R
toHaveStyle(css: string | Record<string, any>): R
/**
* @description
* Check whether the given element has a text content or not.
Expand Down