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

Commit

Permalink
test: update more bits
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 3, 2022
1 parent 2eda035 commit efbfe77
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
5 changes: 4 additions & 1 deletion test/fixtures/basic/components/Nested/SugarCounter.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<script setup lang="ts">
defineProps({
count: Number
count: {
type: Number,
required: true
}
})
</script>

Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/basic/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default defineNuxtConfig({
},
function (_options, nuxt) {
const routesToDuplicate = ['/async-parent', '/fixed-keyed-child-parent', '/keyed-child-parent', '/with-layout', '/with-layout2']
const stripLayout = (page: NuxtPage) => ({
const stripLayout = (page: NuxtPage): NuxtPage => ({
...page,
children: page.children?.map(child => stripLayout(child)),
name: 'internal-' + page.name,
Expand All @@ -92,7 +92,7 @@ export default defineNuxtConfig({
],
hooks: {
'prepare:types' ({ tsConfig }) {
tsConfig.include = tsConfig.include.filter(i => i !== '../../../../**/*')
tsConfig.include = tsConfig.include!.filter(i => i !== '../../../../**/*')
},
'modules:done' () {
addComponent({
Expand All @@ -103,7 +103,7 @@ export default defineNuxtConfig({
}
},
experimental: {
inlineSSRStyles: id => !id.includes('assets.vue'),
inlineSSRStyles: id => !!id && !id.includes('assets.vue'),
reactivityTransform: true,
treeshakeClientOnly: true
},
Expand Down
11 changes: 7 additions & 4 deletions test/fixtures/basic/pages/client-only-components.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@
</template>

<script setup lang="ts">
const stringStatefulComp = ref(null)
const stringStatefulScriptComp = ref(null)
const clientScript = ref(null)
const clientSetupScript = ref(null)
import { Ref } from 'vue'
type Comp = Ref<{ add: () => void }>
const stringStatefulComp = ref(null) as any as Comp
const stringStatefulScriptComp = ref(null) as any as Comp
const clientScript = ref(null) as any as Comp
const clientSetupScript = ref(null) as any as Comp
const show = ref(false)
</script>
14 changes: 7 additions & 7 deletions test/fixtures/basic/pages/useAsyncData/refresh.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@
const { data, refresh } = await useCounter()
const { data: data2, refresh: refresh2 } = await useCounter()
let inital = data.value.count
let initial = data.value!.count
// Refresh on client and server side
await refresh()
if (data.value.count !== inital + 1) {
throw new Error('Data not refreshed?' + data.value.count + ' : ' + data2.value.count)
if (data.value!.count !== initial + 1) {
throw new Error('Data not refreshed?' + data.value!.count + ' : ' + data2.value!.count)
}
if (data.value.count !== data2.value.count) {
if (data.value!.count !== data2.value!.count) {
throw new Error('AsyncData not synchronised')
}
inital = data.value.count
initial = data.value!.count
await refresh2()
if (data.value.count !== inital + 1) {
if (data.value!.count !== initial + 1) {
throw new Error('data2 refresh not syncronised?')
}
if (data.value.count !== data2.value.count) {
if (data.value!.count !== data2.value!.count) {
throw new Error('AsyncData not synchronised')
}
Expand Down

0 comments on commit efbfe77

Please sign in to comment.