You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/prop-accessors/_config.js

17 lines
365 B

export default {
accessors: false,
test({ assert, component }) {
assert.equal(component.foo1, 42);
assert.equal(component.foo2(), 42);
assert.equal(component.bar, undefined);
assert.throws(() => {
component.foo1 = null;
}, /Cannot set property foo1 of/);
assert.throws(() => {
component.foo2 = null;
}, /Cannot set property foo2 of/);
}
};