diff --git a/src/utils/compileSlots.ts b/src/utils/compileSlots.ts index 90d715acd..f0f12a6d7 100644 --- a/src/utils/compileSlots.ts +++ b/src/utils/compileSlots.ts @@ -1,7 +1,8 @@ import { compile } from '@vue/compiler-dom' import * as vue from 'vue' -export function processSlot(template = '', Vue = vue) { +export function processSlot(source = '', Vue = vue) { + let template = source.trim() const hasWrappingTemplate = template && template.startsWith(' { }) it('allows passing a scoped slot via string with no destructuring using the v-slot syntax ', () => { + // Note: there is intentionally a carriage return after the first ` in the scoped key. + // https://github.com/vuejs/vue-test-utils-next/issues/202 const wrapper = mount(ComponentWithSlots, { slots: { - scoped: `` + scoped: ` + + ` } })