Skip to content

Commit

Permalink
fix(types): add render() (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
38elements authored and eddyerburgh committed May 16, 2018
1 parent 528d637 commit f5d4a0f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/server-test-utils/types/index.d.ts
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
@@ -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

0 comments on commit f5d4a0f

Please sign in to comment.