Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 390006e

Browse files
test: add test for optionsPath
1 parent 003752e commit 390006e

File tree

13 files changed

+566
-664
lines changed

13 files changed

+566
-664
lines changed

‎test/basic.test.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import { setupTest, getNuxt, get, url } from '@nuxt/test-utils'
33
describe('basic', () => {
44
setupTest({
55
server: true,
6-
fixture: 'fixture/basic',
7-
configFile: 'nuxt.config.ts'
6+
fixture: 'fixture/basic'
87
})
98

109
test('echo should be defined', async () => {
11-
/* @ts-ignore */
1210
const window = await getNuxt().renderAndGetWindow(url('/'))
1311
expect(window.$nuxt.$echo).toBeDefined()
1412
})

‎test/custom-options-path.test.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { setupTest, getNuxt, get, url } from '@nuxt/test-utils'
2+
3+
describe('custom-options-path', () => {
4+
setupTest({
5+
server: true,
6+
fixture: 'fixture/custom-options-path'
7+
})
8+
9+
test('onAfterConnect should be defined', async () => {
10+
const window = await getNuxt().renderAndGetWindow(url('/'))
11+
expect(window.$nuxt.$echo.options.onAfterConnect).toBeDefined()
12+
})
13+
14+
test('render', async () => {
15+
const { body } = await get('/')
16+
expect(body).toContain('Works!')
17+
})
18+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
onAfterConnect () {
3+
//
4+
}
5+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
import { NuxtConfig } from '@nuxt/types'
3+
4+
export default <NuxtConfig> {
5+
buildModules: [
6+
'@nuxt/typescript-build',
7+
'../../../src/module.ts'
8+
],
9+
10+
echo: {
11+
optionsPath: './laravel-echo.ts'
12+
}
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div>
3+
Works!
4+
</div>
5+
</template>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../../../tsconfig.json"
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
onBeforeConnect () {
3+
//
4+
}
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
import { NuxtConfig } from '@nuxt/types'
3+
4+
export default <NuxtConfig> {
5+
buildModules: [
6+
'@nuxt/typescript-build',
7+
'../../../src/module.ts'
8+
]
9+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div>
3+
Works!
4+
</div>
5+
</template>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../../../tsconfig.json"
3+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /