fix weird bug in tests

pull/15844/head
Rich Harris 3 months ago
parent 8cd5635c88
commit c04a13b8d3

@ -302,3 +302,13 @@ export class Batch {
return current_batch;
}
}
/**
* Forcibly remove all current batches
* TODO investigate why we need this in tests
*/
export function clear() {
for (const batch of batches) {
batch.remove();
}
}

@ -11,6 +11,7 @@ import { assert_html_equal, assert_html_equal_with_options } from '../html_equal
import { raf } from '../animation-helpers.js';
import type { CompileOptions } from '#compiler';
import { suite_with_variants, type BaseTest } from '../suite.js';
import { clear } from '../../src/internal/client/reactivity/batch.js';
type Assert = typeof import('vitest').assert & {
htmlEqual(a: string, b: string, description?: string): void;
@ -521,6 +522,8 @@ async function run_test_variant(
console.log = console_log;
console.warn = console_warn;
console.error = console_error;
clear();
}
}

Loading…
Cancel
Save