fix(baseline): restore browser resolve conditions + fix onDelete handler type
4ca532b accidentally dropped vitest.config.ts browser resolve conditions,
environmentMatchGlobs, and hot:false — causing job-error-line.test.ts to
mount against svelte/index-server.js and fail with lifecycle_function_unavailable.
Also fixes JobErrorLine.svelte line 45: onDelete passed directly as onclick
is typed (jobId:string)=>void, not MouseEventHandler — wrap to match handler
signature, consistent with the failed-branch delete button already there.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
6bd0bdf1e3
commit
60782001e0
@@ -42,7 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{:else if job.status === 'done' && job.segmentsJson}
|
{:else if job.status === 'done' && job.segmentsJson}
|
||||||
<div class="recent-err-line">
|
<div class="recent-err-line">
|
||||||
<button class="delete-btn" onclick={onDelete} aria-label={deleteLabel}>{deleteLabel}</button>
|
<button class="delete-btn" onclick={(e) => { e.preventDefault(); e.stopPropagation(); onDelete?.(job.id); }} aria-label={deleteLabel}>{deleteLabel}</button>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -3,12 +3,15 @@ import { svelte } from '@sveltejs/vite-plugin-svelte';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [svelte()],
|
plugins: [svelte({ hot: false })],
|
||||||
test: {
|
test: {
|
||||||
environment: 'node',
|
environment: 'node',
|
||||||
globals: true,
|
globals: true,
|
||||||
fileParallelism: false,
|
fileParallelism: false,
|
||||||
include: ['src/tests/**/*.test.ts'],
|
include: ['src/tests/**/*.test.ts'],
|
||||||
|
environmentMatchGlobs: [
|
||||||
|
['**/job-error-line.test.ts', 'happy-dom']
|
||||||
|
],
|
||||||
coverage: {
|
coverage: {
|
||||||
provider: 'v8',
|
provider: 'v8',
|
||||||
reporter: ['text', 'html'],
|
reporter: ['text', 'html'],
|
||||||
@@ -16,6 +19,7 @@ export default defineConfig({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
|
conditions: ['browser'],
|
||||||
alias: {
|
alias: {
|
||||||
'$lib': path.resolve('./src/lib'),
|
'$lib': path.resolve('./src/lib'),
|
||||||
'$app/environment': path.resolve('./src/tests/__mocks__/app-environment.ts'),
|
'$app/environment': path.resolve('./src/tests/__mocks__/app-environment.ts'),
|
||||||
|
|||||||
Reference in New Issue
Block a user