update validate tests

pull/2230/head
Richard Harris 6 years ago
parent 0f0f947865
commit 73e45ab483

@ -1,3 +1,7 @@
<script>
export let language;
</script>
<html lang="en"></html>
<html lang="en-US"></html>
<html lang={language}></html>

@ -4,14 +4,14 @@
"message": "A11y: <html> element should have a lang attribute",
"start": {
"column": 0,
"line": 5,
"character": 82
"line": 9,
"character": 124
},
"end": {
"line": 5,
"line": 9,
"column": 13,
"character": 95
"character": 137
},
"pos": 82
"pos": 124
}
]

@ -1 +1,5 @@
<iframe src='{src}'></iframe>
<script>
export let src;
</script>
<iframe src={src}></iframe>

@ -3,15 +3,15 @@
"code": "a11y-missing-attribute",
"message": "A11y: <iframe> element should have a title attribute",
"start": {
"line": 1,
"line": 5,
"column": 0,
"character": 0
"character": 37
},
"end": {
"line": 1,
"column": 29,
"character": 29
"line": 5,
"column": 27,
"character": 64
},
"pos": 0
"pos": 37
}
]

@ -1,3 +1,7 @@
<script>
let foo;
</script>
<div tabindex='-1'/>
<div tabindex='0'/>
<div tabindex='1'/>

@ -3,15 +3,15 @@
"code": "a11y-positive-tabindex",
"message": "A11y: avoid tabindex values above zero",
"start": {
"line": 3,
"line": 7,
"column": 5,
"character": 46
"character": 76
},
"end": {
"line": 3,
"line": 7,
"column": 17,
"character": 58
"character": 88
},
"pos": 46
"pos": 76
}
]

@ -1,3 +1,7 @@
<script>
let things;
</script>
{#each things as thing (thing)}
<div animate:foo></div>
{/each}

@ -2,14 +2,14 @@
"code": "missing-declaration",
"message": "'foo' is not defined",
"start": {
"line": 2,
"line": 6,
"column": 6,
"character": 38
"character": 71
},
"end": {
"line": 2,
"line": 6,
"column": 17,
"character": 49
"character": 82
},
"pos": 38
"pos": 71
}]

@ -1,15 +1,15 @@
[{
"code": "invalid-binding",
"message": "'offsetWidth' is not a valid binding on SVG elements",
"pos": 13,
"pos": 51,
"start": {
"line": 2,
"line": 6,
"column": 7,
"character": 13
"character": 51
},
"end": {
"line": 2,
"line": 6,
"column": 23,
"character": 29
"character": 67
}
}]

@ -1,3 +1,7 @@
<script>
let offsetWidth;
</script>
<svg>
<text bind:offsetWidth>some text</text>
</svg>

Before

Width:  |  Height:  |  Size: 53 B

After

Width:  |  Height:  |  Size: 91 B

@ -1,15 +1,15 @@
[{
"code": "invalid-binding",
"message": "'offsetWidth' is not a valid binding on <svg>. Use 'clientWidth' instead",
"pos": 5,
"pos": 43,
"start": {
"line": 1,
"line": 5,
"column": 5,
"character": 5
"character": 43
},
"end": {
"line": 1,
"line": 5,
"column": 21,
"character": 21
"character": 59
}
}]

@ -1 +1,5 @@
<script>
let offsetWidth;
</script>
<svg bind:offsetWidth></svg>

Before

Width:  |  Height:  |  Size: 28 B

After

Width:  |  Height:  |  Size: 66 B

@ -1,15 +1,15 @@
[{
"code": "invalid-binding",
"message": "'offsetWidth' is not a valid binding on void elements like <img>. Use a wrapper element instead",
"pos": 22,
"pos": 60,
"start": {
"line": 1,
"line": 5,
"column": 22,
"character": 22
"character": 60
},
"end": {
"line": 1,
"line": 5,
"column": 38,
"character": 38
"character": 76
}
}]

@ -1 +1,5 @@
<script>
let offsetWidth;
</script>
<img src='potato.jpg' bind:offsetWidth>

@ -2,14 +2,14 @@
"code": "invalid-binding",
"message": "'checked' binding can only be used with <input type=\"checkbox\">",
"start": {
"line": 1,
"line": 5,
"column": 7,
"character": 7
"character": 37
},
"end": {
"line": 1,
"line": 5,
"column": 25,
"character": 25
"character": 55
},
"pos": 7
"pos": 37
}]

@ -1 +1,5 @@
<script>
let foo;
</script>
<input bind:checked={foo}>

@ -2,14 +2,14 @@
"code": "missing-type",
"message": "'type' attribute must be specified",
"start": {
"line": 1,
"line": 5,
"column": 24,
"character": 24
"character": 54
},
"end": {
"line": 1,
"line": 5,
"column": 28,
"character": 28
"character": 58
},
"pos": 24
"pos": 54
}]

@ -1 +1,5 @@
<script>
let foo;
</script>
<input bind:value={foo} type>

@ -2,14 +2,14 @@
"code": "invalid-type",
"message": "'type' attribute cannot be dynamic if input uses two-way binding",
"start": {
"line": 1,
"line": 6,
"column": 24,
"character": 24
"character": 70
},
"end": {
"line": 1,
"column": 42,
"character": 42
"line": 6,
"column": 40,
"character": 86
},
"pos": 24
"pos": 70
}]

@ -1 +1,6 @@
<input bind:value={foo} type='{inputType}'>
<script>
let foo;
let inputType;
</script>
<input bind:value={foo} type={inputType}>

@ -1,15 +1,15 @@
[{
"code": "invalid-binding",
"message": "'value' is not a valid binding on <div> elements",
"pos": 5,
"pos": 37,
"start": {
"line": 1,
"line": 5,
"column": 5,
"character": 5
"character": 37
},
"end": {
"line": 1,
"line": 5,
"column": 15,
"character": 15
"character": 47
}
}]

@ -1 +1,5 @@
<script>
let value;
</script>
<div bind:value></div>

@ -1,15 +1,15 @@
[{
"code": "invalid-binding",
"message": "'whatever' is not a valid binding",
"pos": 5,
"pos": 40,
"start": {
"line": 1,
"line": 5,
"column": 5,
"character": 5
"character": 40
},
"end": {
"line": 1,
"line": 5,
"column": 18,
"character": 18
"character": 53
}
}]

@ -1 +1,5 @@
<script>
let whatever;
</script>
<div bind:whatever></div>

@ -2,14 +2,14 @@
"code": "dynamic-multiple-attribute",
"message": "'multiple' attribute cannot be dynamic if select uses two-way binding",
"start": {
"line": 1,
"line": 6,
"column": 19,
"character": 19
"character": 66
},
"end": {
"line": 1,
"line": 6,
"column": 29,
"character": 29
"character": 76
},
"pos": 19
"pos": 66
}]

@ -1,3 +1,8 @@
<script>
let value;
let multiple;
</script>
<select bind:value {multiple}>
<option>1</option>
<option>2</option>

@ -1,3 +1,8 @@
<script>
export let things;
export let soDoesThis;
</script>
{#each things as thing}
<span>this only exists...</span>
<span>...to increase test coverage</span>

@ -1,3 +1,7 @@
<script>
let things = [];
</script>
{#each things as thing}
{/each}

@ -3,30 +3,30 @@
"code": "empty-block",
"message": "Empty block",
"start": {
"line": 1,
"line": 5,
"column": 0,
"character": 0
"character": 38
},
"end": {
"line": 3,
"line": 7,
"column": 7,
"character": 32
"character": 70
},
"pos": 0
"pos": 38
},
{
"code": "empty-block",
"message": "Empty block",
"start": {
"line": 5,
"line": 9,
"column": 0,
"character": 34
"character": 72
},
"end": {
"line": 5,
"line": 9,
"column": 30,
"character": 64
"character": 102
},
"pos": 34
"pos": 72
}
]

@ -1,3 +1,7 @@
<script>
let x;
</script>
{#if x}
&nbsp;
{/if}

@ -1,3 +1,7 @@
<script>
let value;
</script>
<select bind:value multiple>
<option>1</option>
</select>

@ -7,4 +7,4 @@
export let height;
</script>
<rect x='{x}' y='{y}' width='{width}' height='{height}'/>
<rect x={x} y={y} width={width} height={height}/>

@ -1 +1,8 @@
<rect x='{x}' y='{y}' width='{width}' height='{height}'/>
<script>
export let x;
export let y;
export let width;
export let height;
</script>
<rect x={x} y={y} width={width} height={height}/>

@ -2,14 +2,14 @@
"code": "missing-namespace",
"message": "<rect> is an SVG element did you forget to add <svelte:options namespace=\"svg\"/> ?",
"start": {
"line": 1,
"line": 8,
"column": 0,
"character": 0
"character": 89
},
"end": {
"line": 1,
"column": 57,
"character": 57
"line": 8,
"column": 49,
"character": 138
},
"pos": 0
"pos": 89
}]

@ -1 +1,5 @@
<script>
let online;
</script>
<svelte:window bind:online/>

@ -2,7 +2,7 @@ import * as fs from 'fs';
import * as assert from 'assert';
import { svelte, loadConfig, tryToLoadJson } from '../helpers.js';
describe.only('vars', () => {
describe('vars', () => {
fs.readdirSync('test/vars/samples').forEach(dir => {
if (dir[0] === '.') return;

Loading…
Cancel
Save