Skip to content

Commit e14cd1b

Browse files
committed
chore: fix tests
1 parent 88fbdb4 commit e14cd1b

File tree

13 files changed

+84
-30
lines changed

13 files changed

+84
-30
lines changed

.nuxtrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
imports.autoImport=true
2+
modules[]=@nuxt/scripts

src/runtime/components/ScriptVimeoPlayer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ const { data: payload } = useAsyncData(
160160
params: {
161161
url: `https://vimeo.com/${id.value}`,
162162
format: 'json',
163-
}
163+
},
164164
}),
165165
{
166166
lazy: true,
167-
}
167+
},
168168
)
169169
170170
const placeholder = computed(() => {

test/e2e/base.test.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@ import { createPage, setup } from '@nuxt/test-utils/e2e'
44

55
const { resolve } = createResolver(import.meta.url)
66

7-
await setup({
8-
rootDir: resolve('../fixtures/basic'),
9-
// dev: true,
10-
browser: true,
11-
nuxtConfig: {
12-
app: {
13-
baseURL: '/foo',
7+
describe('base', async () => {
8+
await setup({
9+
rootDir: resolve('../fixtures/basic'),
10+
// dev: true,
11+
browser: true,
12+
nuxtConfig: {
13+
app: {
14+
baseURL: '/foo',
15+
},
1416
},
15-
},
16-
})
17-
18-
describe('base', () => {
17+
})
1918
it('bundle', async () => {
2019
const page = await createPage('/foo/bundle-use-script')
2120
await page.waitForTimeout(500)

test/e2e/cdn.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { fileURLToPath } from 'node:url'
22
import { describe, expect, it } from 'vitest'
3-
// import { createResolver } from '@nuxt/kit'
3+
import { createResolver } from '@nuxt/kit'
44
import { $fetch, setup } from '@nuxt/test-utils/e2e'
55

6-
// const { resolve } = createResolver(import.meta.url)
6+
const { resolve } = createResolver(import.meta.url)
77

88
describe('cdnURL', async () => {
99
await setup({
10-
rootDir: fileURLToPath(new URL('../fixtures/cdn', import.meta.url)),
10+
rootDir: resolve('../fixtures/cdn'),
1111
nuxtConfig: {
1212
nitro: {
1313
prerender: {
@@ -16,7 +16,6 @@ describe('cdnURL', async () => {
1616
},
1717
},
1818
})
19-
2019
it('should use cdnURL for bundled scripts', async () => {
2120
const html = await $fetch('/')
2221

test/e2e/extend-registry.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ import { parseURL } from 'ufo'
55

66
const { resolve } = createResolver(import.meta.url)
77

8-
await setup({
9-
rootDir: resolve('../fixtures/extend-registry'),
10-
dev: true,
11-
browser: true,
12-
})
13-
14-
describe('basic', () => {
8+
describe('basic', async () => {
9+
await setup({
10+
rootDir: resolve('../fixtures/extend-registry'),
11+
})
1512
it('extended registry script loads and executes function', async () => {
1613
const page = await createPage()
1714
const logs: { text: string, location: string }[] = []

test/fixtures/basic/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./.nuxt/tsconfig.json"
3+
}

test/fixtures/basic/vitest.config.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/fixtures/cdn/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function loadScript() {
2525
},
2626
})
2727
28-
$script.then((script) => {
28+
$script.then(() => {
2929
scriptStatus.value = 'loaded'
3030
// Script loaded successfully
3131
}).catch(() => {

test/fixtures/cdn/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./.nuxt/tsconfig.json"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./.nuxt/tsconfig.json"
3+
}

0 commit comments

Comments
 (0)