Skip to content

Commit 6b78f34

Browse files
committed
test(proxy): adjust expected values for proxy configuration
1 parent 7fb9576 commit 6b78f34

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

tests/integration/module.spec.ts

+26-26
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jest.mock('execa')
1414
const execaMock = (execa as unknown) as jest.Mock
1515
const execaOnMock = jest.fn()
1616
const laravelMock = jest.fn().mockReturnValue({
17-
on: execaOnMock
17+
on: execaOnMock,
1818
})
1919
execaMock.mockImplementation((program: string, params: string[]) => {
2020
if (program === 'php' && params[0] && params[0] === 'artisan')
@@ -100,8 +100,8 @@ describe('module tests', () => {
100100
...options,
101101
laravel: {
102102
root: laravelRoot,
103-
...(options && options.laravel)
104-
}
103+
...(options && options.laravel),
104+
},
105105
})
106106
)
107107
).nuxt
@@ -110,12 +110,12 @@ describe('module tests', () => {
110110
const testProxy = (proxy: any, host = 'http://localhost:3001') => {
111111
expect(proxy).toBeDefined()
112112
expect(proxy).toContainEqual([
113-
['**/*', `!/${moduleKey}`, '!/_loading'],
113+
['**', `!/${moduleKey}`, '!/_loading/**'],
114114
{
115115
target: host,
116116
ws: false,
117-
logLevel: 'debug'
118-
}
117+
logLevel: 'debug',
118+
},
119119
])
120120
}
121121

@@ -132,7 +132,7 @@ describe('module tests', () => {
132132
port: 3001,
133133
origin: 'http://localhost:3000',
134134
path: moduleKey,
135-
...overrides
135+
...overrides,
136136
}
137137
expect(execaMock).toHaveBeenCalledTimes(1)
138138
expect(execaMock).toHaveBeenCalledWith(
@@ -142,8 +142,8 @@ describe('module tests', () => {
142142
cwd: laravelRoot,
143143
env: expect.objectContaining({
144144
[laravelAppEnv]: config.origin,
145-
[nuxtOutputEnv]: `${config.origin}/${moduleKey}`
146-
})
145+
[nuxtOutputEnv]: `${config.origin}/${moduleKey}`,
146+
}),
147147
})
148148
)
149149
expect(execaOnMock).toHaveBeenCalledTimes(1)
@@ -174,9 +174,9 @@ describe('module tests', () => {
174174
root: laravelRoot,
175175
server: {
176176
host: 'host.test',
177-
port: 8080
178-
}
179-
}
177+
port: 8080,
178+
},
179+
},
180180
})
181181
)
182182
).nuxt
@@ -219,7 +219,7 @@ describe('module tests', () => {
219219
expect.objectContaining({
220220
name: moduleKey,
221221
path: `/${moduleKey}`,
222-
component: expect.stringMatching(/index\.vue$/)
222+
component: expect.stringMatching(/index\.vue$/),
223223
})
224224
)
225225
})
@@ -253,7 +253,7 @@ describe('module tests', () => {
253253
const testHost = 'host.test'
254254
const testPort = 3000
255255
await setNuxt({
256-
laravel: { server: { host: testHost, port: testPort } }
256+
laravel: { server: { host: testHost, port: testPort } },
257257
})
258258

259259
testProxy(nuxt.options.proxy, `http://${testHost}:${testPort}`)
@@ -274,7 +274,7 @@ describe('module tests', () => {
274274
testProxy(nuxt.options.proxy, `http://localhost:${nuxtPort + 1}`)
275275
testServer({
276276
port: nuxtPort + 1,
277-
origin: `http://localhost:${nuxtPort}`
277+
origin: `http://localhost:${nuxtPort}`,
278278
})
279279
}, 60000)
280280

@@ -322,8 +322,8 @@ describe('module tests', () => {
322322
...options,
323323
laravel: {
324324
root: laravelRoot,
325-
...(options && options.laravel)
326-
}
325+
...(options && options.laravel),
326+
},
327327
})
328328
)
329329
).nuxt
@@ -373,7 +373,7 @@ describe('module tests', () => {
373373
expect.objectContaining({
374374
dir: `${laravelRoot}/${moduleKey}`,
375375
exclude: [/.*/],
376-
fallback: 'spa.html'
376+
fallback: 'spa.html',
377377
})
378378
)
379379
expect(infoSpy).toHaveBeenNthCalledWith(
@@ -416,7 +416,7 @@ describe('module tests', () => {
416416
expect.objectContaining({
417417
dir: `${laravelRoot}/${moduleKey}`,
418418
exclude: [/.*/],
419-
fallback: outName
419+
fallback: outName,
420420
})
421421
)
422422
expect(infoSpy).toHaveBeenNthCalledWith(
@@ -447,16 +447,16 @@ describe('module tests', () => {
447447

448448
expect(nuxt.options.generate).toEqual(
449449
expect.objectContaining({
450-
fallback: 'index.html'
450+
fallback: 'index.html',
451451
})
452452
)
453453
}, 60000)
454454

455455
test('additional output file', async () => {
456456
await nuxtSetup({
457457
laravel: {
458-
outputPath: 'storage/spa.html'
459-
}
458+
outputPath: 'storage/spa.html',
459+
},
460460
})
461461

462462
expect(infoSpy).toHaveBeenNthCalledWith(
@@ -561,8 +561,8 @@ describe('module tests', () => {
561561
test('additional output is skipped if it corresponds to default output', async () => {
562562
await nuxtSetup({
563563
laravel: {
564-
outputPath: 'public/spa.html'
565-
}
564+
outputPath: 'public/spa.html',
565+
},
566566
})
567567

568568
expect(infoSpy).toHaveBeenNthCalledWith(
@@ -584,8 +584,8 @@ describe('module tests', () => {
584584

585585
await nuxtSetup({
586586
laravel: {
587-
outputPath: 'storage/spa.html'
588-
}
587+
outputPath: 'storage/spa.html',
588+
},
589589
})
590590

591591
expect(infoSpy).toHaveBeenNthCalledWith(

0 commit comments

Comments
 (0)