-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: typescript define type of renderer
- Loading branch information
1 parent
fc66831
commit bba5a09
Showing
19 changed files
with
142 additions
and
22 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
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
plugins/cc-cli/templates/framework-render/enzyme-react-17.esm.js
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,14 @@ | ||
{{? it.bundle }} | ||
const rendered = renderFn(story, doc); | ||
{{?? true }} | ||
const rendered = renderExample({ | ||
example, | ||
doc, | ||
config, | ||
}); | ||
{{?}} | ||
it('snapshot', () => { | ||
const component = mount(rendered); | ||
expect(toJson(component, { mode: 'deep' })).toMatchSnapshot(); | ||
}); | ||
{{=it.allytest}} |
14 changes: 14 additions & 0 deletions
14
plugins/cc-cli/templates/framework-render/enzyme-react-17.ts.js
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,14 @@ | ||
{{? it.bundle }} | ||
const rendered = renderFn(story, doc); | ||
{{?? true }} | ||
const rendered = renderExample({ | ||
example, | ||
doc, | ||
config, | ||
}); | ||
{{?}} | ||
it('snapshot', () => { | ||
const component = mount(rendered); | ||
expect(toJson(component, { mode: 'deep' })).toMatchSnapshot(); | ||
}); | ||
{{=it.allytest}} |
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
plugins/cc-cli/templates/framework-render/react-test-renderer.esm.js
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,25 @@ | ||
let rendered; | ||
act(() => { | ||
{{? it.bundle }} | ||
rendered = renderFn(story, doc); | ||
{{?? true }} | ||
rendered = renderExample({ | ||
example, | ||
doc, | ||
config, | ||
}); | ||
{{?}} | ||
}) | ||
if (!rendered) { | ||
renderErr(); | ||
return; | ||
} | ||
it('snapshot', () => { | ||
const component = renderer.create(rendered); | ||
if (!component) { | ||
componentErr(); | ||
return; | ||
} | ||
expect(component.toJSON()).toMatchSnapshot(); | ||
}); | ||
{{=it.allytest}} |
25 changes: 25 additions & 0 deletions
25
plugins/cc-cli/templates/framework-render/react-test-renderer.ts.js
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,25 @@ | ||
let rendered: ReturnType<typeof renderExample> = undefined as any; | ||
act(() => { | ||
{{? it.bundle }} | ||
rendered = renderFn(story, doc); | ||
{{?? true }} | ||
rendered = renderExample({ | ||
example, | ||
doc, | ||
config, | ||
}); | ||
{{?}} | ||
}) | ||
if (!rendered) { | ||
renderErr(); | ||
return; | ||
} | ||
it('snapshot', () => { | ||
const component = renderer.create(rendered); | ||
if (!component) { | ||
componentErr(); | ||
return; | ||
} | ||
expect(component.toJSON()).toMatchSnapshot(); | ||
}); | ||
{{=it.allytest}} |
File renamed without changes.
21 changes: 21 additions & 0 deletions
21
plugins/cc-cli/templates/framework-render/react-testing-library.esm.js
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,21 @@ | ||
let rendered; | ||
act(() => { | ||
{{? it.bundle }} | ||
rendered = renderFn(story, doc); | ||
{{?? true }} | ||
rendered = renderExample({ | ||
example, | ||
doc, | ||
config, | ||
}); | ||
{{?}} | ||
}); | ||
if (!rendered) { | ||
renderErr(); | ||
return; | ||
} | ||
it('snapshot', () => { | ||
const { asFragment } = render(rendered); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
{{=it.allytest}} |
21 changes: 21 additions & 0 deletions
21
plugins/cc-cli/templates/framework-render/react-testing-library.ts.js
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,21 @@ | ||
let rendered: ReturnType<typeof renderExample> = undefined as any; | ||
act(() => { | ||
{{? it.bundle }} | ||
rendered = renderFn(story, doc); | ||
{{?? true }} | ||
rendered = renderExample({ | ||
example, | ||
doc, | ||
config, | ||
}); | ||
{{?}} | ||
}); | ||
if (!rendered) { | ||
renderErr(); | ||
return; | ||
} | ||
it('snapshot', () => { | ||
const { asFragment } = render(rendered); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); | ||
{{=it.allytest}} |
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
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
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
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