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>
|
||||
{:else if job.status === 'done' && job.segmentsJson}
|
||||
<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>
|
||||
{/if}
|
||||
|
||||
|
||||
+5
-1
@@ -3,12 +3,15 @@ import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||
import path from 'path';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [svelte()],
|
||||
plugins: [svelte({ hot: false })],
|
||||
test: {
|
||||
environment: 'node',
|
||||
globals: true,
|
||||
fileParallelism: false,
|
||||
include: ['src/tests/**/*.test.ts'],
|
||||
environmentMatchGlobs: [
|
||||
['**/job-error-line.test.ts', 'happy-dom']
|
||||
],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'html'],
|
||||
@@ -16,6 +19,7 @@ export default defineConfig({
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
conditions: ['browser'],
|
||||
alias: {
|
||||
'$lib': path.resolve('./src/lib'),
|
||||
'$app/environment': path.resolve('./src/tests/__mocks__/app-environment.ts'),
|
||||
|
||||
Reference in New Issue
Block a user