-
-
Notifications
You must be signed in to change notification settings - Fork 726
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: enable jest to test ts and tsx files (#4785)
Co-authored-by: Victor Fernandez de Alba <sneridagh@gmail.com>
- Loading branch information
1 parent
a3e904c
commit 55e3421
Showing
14 changed files
with
367 additions
and
255 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1 +1 @@ | ||
TypeScript support in core @sneridagh | ||
TypeScript support in core @sneridagh @ninanoleto |
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -25,5 +25,3 @@ export default function getListingBlockAsyncData({ | |
), | ||
]; | ||
} | ||
|
||
export default getListingBlockAsyncData; |
This file contains 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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
export SearchDetails from './SearchDetails'; | ||
export Facets from './Facets'; | ||
export SelectFacet from './SelectFacet'; | ||
export CheckboxFacet from './CheckboxFacet'; | ||
export DateRangeFacet from './DateRangeFacet'; | ||
export SearchInput from './SearchInput'; | ||
export FilterList from './FilterList'; | ||
export SortOn from './SortOn'; | ||
export ToggleFacet from './ToggleFacet'; | ||
export SelectFacetFilterListEntry from './SelectFacetFilterListEntry'; | ||
export ToggleFacetFilterListEntry from './ToggleFacetFilterListEntry'; | ||
export DateRangeFacetFilterListEntry from './DateRangeFacetFilterListEntry'; | ||
export ViewSwitcher from './ViewSwitcher'; | ||
export { default as SearchDetails } from './SearchDetails'; | ||
export { default as Facets } from './Facets'; | ||
export { default as SelectFacet } from './SelectFacet'; | ||
export { default as CheckboxFacet } from './CheckboxFacet'; | ||
export { default as DateRangeFacet } from './DateRangeFacet'; | ||
export { default as SearchInput } from './SearchInput'; | ||
export { default as FilterList } from './FilterList'; | ||
export { default as SortOn } from './SortOn'; | ||
export { default as ToggleFacet } from './ToggleFacet'; | ||
export { default as SelectFacetFilterListEntry } from './SelectFacetFilterListEntry'; | ||
export { default as ToggleFacetFilterListEntry } from './ToggleFacetFilterListEntry'; | ||
export { default as DateRangeFacetFilterListEntry } from './DateRangeFacetFilterListEntry'; | ||
export { default as ViewSwitcher } from './ViewSwitcher'; |
This file contains 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export withQueryString from './withQueryString'; | ||
export withSearch from './withSearch'; | ||
export { default as withQueryString } from './withQueryString'; | ||
export { default as withSearch } from './withSearch'; |
This file contains 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,11 @@ | ||
import renderer from 'react-test-renderer'; | ||
import TsTest from './TsTest'; | ||
|
||
describe('Ts test component', () => { | ||
test('Renders', () => { | ||
const component = renderer.create(<TsTest text="Test a TS component" />); | ||
const json = component.toJSON(); | ||
|
||
expect(json).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains 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,15 @@ | ||
/** | ||
* TEST COMPONENT: React TSX component | ||
* Ensure successful implementation of TSX and validate the functionality with Jest tests | ||
* Dependencies: jest (version 26.6.3), ts-jest (version ^26.4.2) | ||
*/ | ||
|
||
type TestProps = { | ||
text: string; | ||
}; | ||
|
||
const TsTest = ({ text }: TestProps) => { | ||
return <div>{text}</div>; | ||
}; | ||
|
||
export default TsTest; |
7 changes: 7 additions & 0 deletions
7
src/components/theme/TsTest/__snapshots__/TsTest.test.tsx.snap
This file contains 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,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Ts test component Renders 1`] = ` | ||
<div> | ||
Test a TS component | ||
</div> | ||
`; |
This file contains 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export * from './withBlockSchemaEnhancer'; | ||
export withBlockExtensions, { | ||
export { | ||
default as withBlockExtensions, | ||
resolveExtension, | ||
resolveBlockExtensions, | ||
} from './withBlockExtensions'; |
This file contains 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 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
Oops, something went wrong.