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

fix(types): add render() to packages/server-test-utils/types/index.d.ts #618

Merged
merged 1 commit into from
May 16, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/server-test-utils/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ interface VueTestUtilsConfigOptions {

export declare let config: VueTestUtilsConfigOptions

export declare function render<V extends Vue> (component: VueClass<V>, options?: ThisTypedMountOptions<V>): string
export declare function render<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedMountOptions<V>): string
export declare function render (component: FunctionalComponentOptions, options?: MountOptions<Vue>): string

export declare function renderToString<V extends Vue> (component: VueClass<V>, options?: ThisTypedMountOptions<V>): string
export declare function renderToString<V extends Vue> (component: ComponentOptions<V>, options?: ThisTypedMountOptions<V>): string
export declare function renderToString (component: FunctionalComponentOptions, options?: MountOptions<Vue>): string
15 changes: 14 additions & 1 deletion packages/server-test-utils/types/test/renderToString.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import Vuex from 'vuex'
import { renderToString, config } from '../'
import { render, renderToString, config } from '../'
import { normalOptions, functionalOptions, Normal, ClassComponent } from './resources'

const store = new Vuex.Store({})

render(
{
template: '<p>foo</p>'
},
{
attachToDocument: true,
scopedSlots: {
foo: `<div>Foo</div>`
},
sync: false
}
)

renderToString(ClassComponent, {
mocks: {
$store: store
Expand Down