mirror of https://github.com/vuejs/core.git
test(vapor): skip todo tests
This commit is contained in:
parent
527905a85b
commit
ab6f75d1da
|
@ -1,10 +1,10 @@
|
|||
import { ref } from '@vue/reactivity'
|
||||
import { makeRender } from './_utils'
|
||||
import { createFor, createSelector, nextTick, renderEffect } from '../src/_old'
|
||||
// import { createFor, createSelector, nextTick, renderEffect } from '../src'
|
||||
|
||||
const define = makeRender()
|
||||
|
||||
describe('api: createSelector', () => {
|
||||
describe.todo('api: createSelector', () => {
|
||||
test('basic', async () => {
|
||||
let calledTimes = 0
|
||||
let expectedCalledTimes = 0
|
||||
|
|
|
@ -11,13 +11,13 @@ import {
|
|||
resolveComponent,
|
||||
resolveDirective,
|
||||
withDirectives,
|
||||
} from '../src/_old'
|
||||
import { warn } from '../src/_old/warning'
|
||||
} from '../src'
|
||||
import { warn } from '@vue/runtime-dom'
|
||||
import { makeRender } from './_utils'
|
||||
|
||||
const define = makeRender()
|
||||
|
||||
describe('api: createVaporApp', () => {
|
||||
describe.todo('api: createVaporApp', () => {
|
||||
test('mount', () => {
|
||||
const Comp = defineComponent({
|
||||
props: {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import { ref, shallowRef } from '@vue/reactivity'
|
||||
import { createComponent } from '../src/_old/apiCreateComponent'
|
||||
import { createComponent } from '../src/component'
|
||||
import { setRef } from '../src/dom/templateRef'
|
||||
import { makeRender } from './_utils'
|
||||
import {
|
||||
type ComponentInternalInstance,
|
||||
getCurrentInstance,
|
||||
} from '../src/_old/component'
|
||||
import { defineComponent } from '../src/_old/apiDefineComponent'
|
||||
} from '../src/component'
|
||||
import { defineVaporComponent } from '../src/apiDefineComponent'
|
||||
|
||||
const define = makeRender()
|
||||
describe('api: expose', () => {
|
||||
describe.todo('api: expose', () => {
|
||||
test('via setup context', () => {
|
||||
const Child = defineComponent({
|
||||
const Child = defineVaporComponent({
|
||||
setup(_, { expose }) {
|
||||
expose({
|
||||
foo: 1,
|
||||
|
@ -40,7 +40,7 @@ describe('api: expose', () => {
|
|||
|
||||
test('via setup context (expose empty)', () => {
|
||||
let childInstance: ComponentInternalInstance | null = null
|
||||
const Child = defineComponent({
|
||||
const Child = defineVaporComponent({
|
||||
setup(_) {
|
||||
childInstance = getCurrentInstance()
|
||||
},
|
||||
|
|
|
@ -13,13 +13,13 @@ import {
|
|||
ref,
|
||||
renderEffect,
|
||||
setText,
|
||||
} from '../src/_old'
|
||||
} from '../src'
|
||||
import { makeRender } from './_utils'
|
||||
|
||||
const define = makeRender<any>()
|
||||
|
||||
// reference: https://vue-composition-api-rfc.netlify.com/api.html#provide-inject
|
||||
describe('api: provide/inject', () => {
|
||||
describe.todo('api: provide/inject', () => {
|
||||
it('string keys', () => {
|
||||
const Provider = define({
|
||||
setup() {
|
||||
|
|
|
@ -24,13 +24,13 @@ import {
|
|||
renderEffect,
|
||||
setText,
|
||||
template,
|
||||
} from '../src/_old'
|
||||
} from '../src'
|
||||
import { makeRender } from './_utils'
|
||||
import { ITERATE_KEY } from '@vue/reactivity'
|
||||
|
||||
const define = makeRender<any>()
|
||||
|
||||
describe('api: lifecycle hooks', () => {
|
||||
describe.todo('api: lifecycle hooks', () => {
|
||||
it('onBeforeMount', () => {
|
||||
const fn = vi.fn(() => {
|
||||
expect(host.innerHTML).toBe(``)
|
||||
|
|
|
@ -14,12 +14,12 @@ import {
|
|||
setInheritAttrs,
|
||||
template,
|
||||
watchEffect,
|
||||
} from '../src/_old'
|
||||
} from '../src'
|
||||
import { makeRender } from './_utils'
|
||||
|
||||
const define = makeRender()
|
||||
|
||||
describe('api: setup context', () => {
|
||||
describe.todo('api: setup context', () => {
|
||||
it('should expose return values to template render context', () => {
|
||||
const { html } = define({
|
||||
setup() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { SetupContext } from '../src/_old/component'
|
||||
import type { SetupContext } from '../src/component'
|
||||
import {
|
||||
createComponent,
|
||||
defineComponent,
|
||||
|
@ -6,12 +6,12 @@ import {
|
|||
template,
|
||||
useAttrs,
|
||||
useSlots,
|
||||
} from '../src/_old'
|
||||
} from '../src'
|
||||
import { makeRender } from './_utils'
|
||||
|
||||
const define = makeRender<any>()
|
||||
|
||||
describe('SFC <script setup> helpers', () => {
|
||||
describe.todo('SFC <script setup> helpers', () => {
|
||||
test.todo('should warn runtime usage', () => {})
|
||||
|
||||
test('useSlots / useAttrs (no args)', () => {
|
||||
|
|
|
@ -6,9 +6,9 @@ import {
|
|||
ref,
|
||||
watchEffect,
|
||||
watchSyncEffect,
|
||||
} from '../src/_old'
|
||||
} from '../src'
|
||||
|
||||
describe('watchEffect and onWatcherCleanup', () => {
|
||||
describe.todo('watchEffect and onWatcherCleanup', () => {
|
||||
test('basic', async () => {
|
||||
let dummy = 0
|
||||
let source: Ref<number>
|
||||
|
|
|
@ -7,12 +7,12 @@ import {
|
|||
setText,
|
||||
template,
|
||||
watchEffect,
|
||||
} from '../src/_old'
|
||||
} from '../src'
|
||||
import { makeRender } from './_utils'
|
||||
|
||||
const define = makeRender<any>()
|
||||
|
||||
describe('attribute fallthrough', () => {
|
||||
describe.todo('attribute fallthrough', () => {
|
||||
it('should allow attrs to fallthrough', async () => {
|
||||
const t0 = template('<div>')
|
||||
const { component: Child } = define({
|
||||
|
|
|
@ -9,13 +9,13 @@ import {
|
|||
defineComponent,
|
||||
nextTick,
|
||||
onBeforeUnmount,
|
||||
} from '../src/_old'
|
||||
import { isEmitListener } from '../src/_old/componentEmits'
|
||||
} from '../src'
|
||||
import { isEmitListener } from '../src/componentEmits'
|
||||
import { makeRender } from './_utils'
|
||||
|
||||
const define = makeRender()
|
||||
|
||||
describe('component: emit', () => {
|
||||
describe.todo('component: emit', () => {
|
||||
test('trigger handlers', () => {
|
||||
const { render } = define({
|
||||
setup(_, { emit }) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { type Ref, ref } from '@vue/reactivity'
|
|||
|
||||
const define = makeRender()
|
||||
|
||||
describe('component expose', () => {
|
||||
describe.todo('component expose', () => {
|
||||
test('should work', async () => {
|
||||
const expxosedObj = { foo: 1 }
|
||||
const { render } = define({
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
setText,
|
||||
template,
|
||||
withDestructure,
|
||||
} from '../src/_old'
|
||||
} from '../src'
|
||||
import { makeRender } from './_utils'
|
||||
|
||||
const define = makeRender<any>()
|
||||
|
@ -40,7 +40,7 @@ function renderWithSlots(slots: any): any {
|
|||
return instance
|
||||
}
|
||||
|
||||
describe('component: slots', () => {
|
||||
describe.todo('component: slots', () => {
|
||||
test('initSlots: instance.slots should be set correctly', () => {
|
||||
let instance: any
|
||||
const Comp = defineComponent({
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
vModelDynamic,
|
||||
vModelSelect,
|
||||
withDirectives,
|
||||
} from '../../src/_old'
|
||||
} from '../../src'
|
||||
import { makeRender } from '../_utils'
|
||||
import { nextTick } from '@vue/runtime-dom'
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
template,
|
||||
vShow,
|
||||
withDirectives,
|
||||
} from '../../src/_old'
|
||||
} from '../../src'
|
||||
import { nextTick, ref } from 'vue'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
import { makeRender } from '../_utils'
|
||||
|
@ -29,7 +29,7 @@ const createDemo = (defaultValue: boolean) =>
|
|||
return n0
|
||||
})
|
||||
|
||||
describe('directive: v-show', () => {
|
||||
describe.todo('directive: v-show', () => {
|
||||
test('basic', async () => {
|
||||
const { host } = createDemo(true).render()
|
||||
const btn = host.querySelector('button')
|
||||
|
|
|
@ -10,24 +10,17 @@ import {
|
|||
setValue,
|
||||
} from '../../src/dom/prop'
|
||||
import { setStyle } from '../../src/dom/style'
|
||||
import {
|
||||
ComponentInternalInstance,
|
||||
setCurrentInstance,
|
||||
} from '../../src/_old/component'
|
||||
import { VaporComponentInstance } from '../../src/component'
|
||||
import { currentInstance, simpleSetCurrentInstance } from '@vue/runtime-dom'
|
||||
import { getMetadata, recordPropMetadata } from '../../src/componentMetadata'
|
||||
import { getCurrentScope } from '@vue/reactivity'
|
||||
|
||||
let removeComponentInstance = NOOP
|
||||
beforeEach(() => {
|
||||
const instance = new ComponentInternalInstance((() => {}) as any, {}, null)
|
||||
const reset = setCurrentInstance(instance)
|
||||
const prev = getCurrentScope()
|
||||
instance.scope.on()
|
||||
const instance = new VaporComponentInstance({}, {}, null)
|
||||
const prev = currentInstance
|
||||
simpleSetCurrentInstance(instance)
|
||||
removeComponentInstance = () => {
|
||||
instance.scope.prevScope = prev
|
||||
instance.scope.off()
|
||||
reset()
|
||||
removeComponentInstance = NOOP
|
||||
simpleSetCurrentInstance(prev)
|
||||
}
|
||||
})
|
||||
afterEach(() => {
|
||||
|
|
|
@ -12,12 +12,12 @@ import {
|
|||
setText,
|
||||
template,
|
||||
watchEffect,
|
||||
} from '../../src/_old'
|
||||
} from '../../src'
|
||||
import { makeRender } from '../_utils'
|
||||
|
||||
const define = makeRender()
|
||||
|
||||
describe('api: template ref', () => {
|
||||
describe.todo('api: template ref', () => {
|
||||
test('string ref mount', () => {
|
||||
const t0 = template('<div ref="refKey"></div>')
|
||||
const el = ref(null)
|
||||
|
|
|
@ -7,12 +7,12 @@ import {
|
|||
template,
|
||||
triggerRef,
|
||||
withDestructure,
|
||||
} from '../src/_old'
|
||||
} from '../src'
|
||||
import { makeRender } from './_utils'
|
||||
|
||||
const define = makeRender()
|
||||
|
||||
describe('createFor', () => {
|
||||
describe.todo('createFor', () => {
|
||||
test('array source', async () => {
|
||||
const list = ref([{ name: '1' }, { name: '2' }, { name: '3' }])
|
||||
function reverse() {
|
||||
|
|
|
@ -8,14 +8,14 @@ import {
|
|||
setText,
|
||||
template,
|
||||
withDirectives,
|
||||
} from '../src/_old'
|
||||
} from '../src'
|
||||
import type { Mock } from 'vitest'
|
||||
import { makeRender } from './_utils'
|
||||
import { unmountComponent } from '../src/_old/apiRender'
|
||||
import { unmountComponent } from '../src/component'
|
||||
|
||||
const define = makeRender()
|
||||
|
||||
describe('createIf', () => {
|
||||
describe.todo('createIf', () => {
|
||||
test('basic', async () => {
|
||||
// mock this template:
|
||||
// <div>
|
||||
|
|
|
@ -38,8 +38,5 @@
|
|||
"scripts/*",
|
||||
"rollup.*.js"
|
||||
],
|
||||
"exclude": [
|
||||
"packages-private/sfc-playground/src/vue-dev-proxy*",
|
||||
"packages/runtime-vapor/src/_old"
|
||||
]
|
||||
"exclude": ["packages-private/sfc-playground/src/vue-dev-proxy*"]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue