pull/16622/head
ComputerGuy 3 weeks ago
parent 62964abd36
commit e738d6ad2c

@ -2,21 +2,25 @@ import { test } from '../../test';
import { normalise_trace_logs } from '../../../helpers.js';
export default test({
compileOptions: {
dev: true
},
compileOptions: {
dev: true
},
test({ assert, logs }) {
assert.deepEqual(normalise_trace_logs(logs), [
{ log: '$state', highlighted: true },
{ log: 'filesState.files', highlighted: false },
{ log: { id: 1, items: [{ id: 2, items: [{ id: 3 }, { id: 4 }] }] } },
{ log: '$state', highlighted: true },
{ log: 'filesState.files.items[0].parent', highlighted: false },
{ log: { id: 1, items: [{ id: 2, items: [{ id: 3 }, { id: 4 }] }] } },
{ log: '$state', highlighted: true },
{ log: 'filesState.files.items[0].parent.items[0]', highlighted: false },
{ log: { id: 2, items: [{ id: 3 }, { id: 4 }] } }
]);
}
test({ assert, logs }) {
const files = { id: 1, items: [{ id: 2, items: [{ id: 3 }, { id: 4 }] }] };
// @ts-expect-error
files.items[0].parent = files;
assert.deepEqual(normalise_trace_logs(logs), [
{ log: 'test (main.svelte:5:4)' },
{ log: '$state', highlighted: true },
{ log: 'filesState.files', highlighted: false },
{ log: files },
{ log: '$state', highlighted: true },
{ log: 'filesState.files.items[0].parent', highlighted: false },
{ log: files },
{ log: '$state', highlighted: true },
{ log: 'filesState.files.items[0].parent.items[0]', highlighted: false },
{ log: files.items[0] }
]);
}
});

Loading…
Cancel
Save