Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

Commit efbfe77

Browse files
committed
test: update more bits
1 parent 2eda035 commit efbfe77

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

test/fixtures/basic/components/Nested/SugarCounter.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<script setup lang="ts">
22
defineProps({
3-
count: Number
3+
count: {
4+
type: Number,
5+
required: true
6+
}
47
})
58
</script>
69

test/fixtures/basic/nuxt.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default defineNuxtConfig({
6767
},
6868
function (_options, nuxt) {
6969
const routesToDuplicate = ['/async-parent', '/fixed-keyed-child-parent', '/keyed-child-parent', '/with-layout', '/with-layout2']
70-
const stripLayout = (page: NuxtPage) => ({
70+
const stripLayout = (page: NuxtPage): NuxtPage => ({
7171
...page,
7272
children: page.children?.map(child => stripLayout(child)),
7373
name: 'internal-' + page.name,
@@ -92,7 +92,7 @@ export default defineNuxtConfig({
9292
],
9393
hooks: {
9494
'prepare:types' ({ tsConfig }) {
95-
tsConfig.include = tsConfig.include.filter(i => i !== '../../../../**/*')
95+
tsConfig.include = tsConfig.include!.filter(i => i !== '../../../../**/*')
9696
},
9797
'modules:done' () {
9898
addComponent({
@@ -103,7 +103,7 @@ export default defineNuxtConfig({
103103
}
104104
},
105105
experimental: {
106-
inlineSSRStyles: id => !id.includes('assets.vue'),
106+
inlineSSRStyles: id => !!id && !id.includes('assets.vue'),
107107
reactivityTransform: true,
108108
treeshakeClientOnly: true
109109
},

test/fixtures/basic/pages/client-only-components.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@
5858
</template>
5959

6060
<script setup lang="ts">
61-
const stringStatefulComp = ref(null)
62-
const stringStatefulScriptComp = ref(null)
63-
const clientScript = ref(null)
64-
const clientSetupScript = ref(null)
61+
import { Ref } from 'vue'
62+
type Comp = Ref<{ add: () => void }>
63+
64+
const stringStatefulComp = ref(null) as any as Comp
65+
const stringStatefulScriptComp = ref(null) as any as Comp
66+
const clientScript = ref(null) as any as Comp
67+
const clientSetupScript = ref(null) as any as Comp
6568
6669
const show = ref(false)
6770
</script>

test/fixtures/basic/pages/useAsyncData/refresh.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@
1111
const { data, refresh } = await useCounter()
1212
const { data: data2, refresh: refresh2 } = await useCounter()
1313
14-
let inital = data.value.count
14+
let initial = data.value!.count
1515
1616
// Refresh on client and server side
1717
await refresh()
1818
19-
if (data.value.count !== inital + 1) {
20-
throw new Error('Data not refreshed?' + data.value.count + ' : ' + data2.value.count)
19+
if (data.value!.count !== initial + 1) {
20+
throw new Error('Data not refreshed?' + data.value!.count + ' : ' + data2.value!.count)
2121
}
2222
23-
if (data.value.count !== data2.value.count) {
23+
if (data.value!.count !== data2.value!.count) {
2424
throw new Error('AsyncData not synchronised')
2525
}
2626
27-
inital = data.value.count
27+
initial = data.value!.count
2828
2929
await refresh2()
3030
31-
if (data.value.count !== inital + 1) {
31+
if (data.value!.count !== initial + 1) {
3232
throw new Error('data2 refresh not syncronised?')
3333
}
3434
35-
if (data.value.count !== data2.value.count) {
35+
if (data.value!.count !== data2.value!.count) {
3636
throw new Error('AsyncData not synchronised')
3737
}
3838

0 commit comments

Comments
 (0)