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/await-function-promise/_config.js

23 lines
376 B

const realPromise = Promise.resolve(42);
const promise = () => {};
promise.then = realPromise.then.bind(realPromise);
promise.catch = realPromise.catch.bind(realPromise);
export default {
get props() {
return { promise };
},
test({ assert, target }) {
return promise.then(() => {
assert.htmlEqual(
target.innerHTML,
`
<p>42</p>
`
);
});
}
};