mirror of https://github.com/sveltejs/svelte
prevent erroneous missing data warnings for custom elements - fixes #1065
parent
29a156957f
commit
9dda4b0563
@ -0,0 +1,3 @@
|
||||
export default {
|
||||
dev: true
|
||||
};
|
@ -0,0 +1,8 @@
|
||||
<p>foo: {{foo}}</p>
|
||||
<p>bar: {{bar}}</p>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
tag: 'my-app'
|
||||
};
|
||||
</script>
|
@ -0,0 +1,18 @@
|
||||
import * as assert from 'assert';
|
||||
import './main.html';
|
||||
|
||||
export default function (target) {
|
||||
const warnings = [];
|
||||
const warn = console.warn;
|
||||
|
||||
console.warn = warning => {
|
||||
warnings.push(warning);
|
||||
};
|
||||
|
||||
target.innerHTML = '<my-app foo=yes />';
|
||||
|
||||
assert.equal(warnings.length, 1);
|
||||
assert.equal(warnings[0], `<my-app> was created without expected data property 'bar'`);
|
||||
|
||||
console.warn = warn;
|
||||
}
|
Loading…
Reference in new issue