mirror of https://github.com/sveltejs/svelte
commit
5c0696dd79
@ -0,0 +1,3 @@
|
||||
This repository is governed by the Svelte Code of Conduct.
|
||||
|
||||
https://github.com/sveltejs/community/blob/main/CODE_OF_CONDUCT.md
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,47 @@
|
||||
export default {
|
||||
html: `
|
||||
<p>#FF0000</p>
|
||||
<p>#00FF00</p>
|
||||
<p>#0000FF</p>
|
||||
`,
|
||||
async test({ component, target, assert }) {
|
||||
component.constant = 20;
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>#FF0000</p>
|
||||
<p>#00FF00</p>
|
||||
<p>#0000FF</p>
|
||||
`);
|
||||
|
||||
component.tags = [
|
||||
{
|
||||
name: 'Red',
|
||||
color: '#FF0000'
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
color: '#00FF00'
|
||||
},
|
||||
{
|
||||
name: 'Blue',
|
||||
color: '#0000FF'
|
||||
},
|
||||
{
|
||||
name: 'Black',
|
||||
color: '#000000'
|
||||
},
|
||||
{
|
||||
name: 'White',
|
||||
color: '#FFFFFF'
|
||||
}
|
||||
];
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>#FF0000</p>
|
||||
<p>#00FF00</p>
|
||||
<p>#0000FF</p>
|
||||
<p>#000000</p>
|
||||
<p>#FFFFFF</p>
|
||||
`);
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,21 @@
|
||||
<script>
|
||||
export let tags = [
|
||||
{
|
||||
name: 'Red',
|
||||
color: '#FF0000'
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
color: '#00FF00'
|
||||
},
|
||||
{
|
||||
name: 'Blue',
|
||||
color: '#0000FF'
|
||||
}
|
||||
];
|
||||
</script>
|
||||
|
||||
{#each tags as tag}
|
||||
{@const tagColor = tags.find(t => t.name === tag.name).color}
|
||||
<p>{tagColor}</p>
|
||||
{/each}
|
||||
@ -0,0 +1,17 @@
|
||||
[
|
||||
{
|
||||
"code": "illegal-variable-declaration",
|
||||
"message": "Cannot declare same variable name which is imported inside <script context=\"module\">",
|
||||
"start": {
|
||||
"line": 6,
|
||||
"column": 1,
|
||||
"character": 86
|
||||
},
|
||||
"end": {
|
||||
"line": 6,
|
||||
"column": 9,
|
||||
"character": 94
|
||||
},
|
||||
"pos": 86
|
||||
}
|
||||
]
|
||||
@ -0,0 +1,9 @@
|
||||
<script context="module">
|
||||
import { FOO } from './dummy.svelte';
|
||||
</script>
|
||||
|
||||
<script>
|
||||
let FOO;
|
||||
</script>
|
||||
|
||||
{FOO}
|
||||
Loading…
Reference in new issue