update test

thunkify-deriveds
Rich Harris 1 day ago
parent 7c4f5956d4
commit 0d658f97ff

@ -1,3 +1,11 @@
import { test } from '../../test';
export default test({});
export default test({
test_ssr({ assert, logs }) {
assert.deepEqual(logs, [0, 2, { count: 2 }, 0, 0, { local_count: 1 }]);
},
test({ assert, logs }) {
assert.deepEqual(logs, [0, 2, { count: 2 }, 0, 0, { local_count: 1 }]);
}
});

@ -2,14 +2,10 @@
import { reset, increment, get, count } from './state.svelte.js';
reset();
get();
console.log(get());
increment();
get();
// non-render-bound deriveds recalculate
if (count !== 2) {
throw new Error(`count was ${count}`);
}
console.log(get());
console.log({ count });
let local_count = 0;
@ -19,11 +15,7 @@
return s * 2;
});
d;
d;
// render-bound deriveds do not
if (local_count !== 1) {
throw new Error(`local_count was ${local_count}`);
}
console.log(d);
console.log(d);
console.log({ local_count });
</script>

Loading…
Cancel
Save