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"></html>
<html lang="en-US"></html> <html lang="en-US"></html>
<html lang={language}></html> <html lang={language}></html>

@ -4,14 +4,14 @@
"message": "A11y: <html> element should have a lang attribute", "message": "A11y: <html> element should have a lang attribute",
"start": { "start": {
"column": 0, "column": 0,
"line": 5, "line": 9,
"character": 82 "character": 124
}, },
"end": { "end": {
"line": 5, "line": 9,
"column": 13, "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", "code": "a11y-missing-attribute",
"message": "A11y: <iframe> element should have a title attribute", "message": "A11y: <iframe> element should have a title attribute",
"start": { "start": {
"line": 1, "line": 5,
"column": 0, "column": 0,
"character": 0 "character": 37
}, },
"end": { "end": {
"line": 1, "line": 5,
"column": 29, "column": 27,
"character": 29 "character": 64
}, },
"pos": 0 "pos": 37
} }
] ]

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

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

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

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

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

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

Before

Width:  |  Height:  |  Size: 53 B

After

Width:  |  Height:  |  Size: 91 B

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

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

Before

Width:  |  Height:  |  Size: 28 B

After

Width:  |  Height:  |  Size: 66 B

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

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

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

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

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

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

@ -2,14 +2,14 @@
"code": "invalid-type", "code": "invalid-type",
"message": "'type' attribute cannot be dynamic if input uses two-way binding", "message": "'type' attribute cannot be dynamic if input uses two-way binding",
"start": { "start": {
"line": 1, "line": 6,
"column": 24, "column": 24,
"character": 24 "character": 70
}, },
"end": { "end": {
"line": 1, "line": 6,
"column": 42, "column": 40,
"character": 42 "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", "code": "invalid-binding",
"message": "'value' is not a valid binding on <div> elements", "message": "'value' is not a valid binding on <div> elements",
"pos": 5, "pos": 37,
"start": { "start": {
"line": 1, "line": 5,
"column": 5, "column": 5,
"character": 5 "character": 37
}, },
"end": { "end": {
"line": 1, "line": 5,
"column": 15, "column": 15,
"character": 15 "character": 47
} }
}] }]

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

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

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

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

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

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

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

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

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

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

@ -7,4 +7,4 @@
export let height; export let height;
</script> </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", "code": "missing-namespace",
"message": "<rect> is an SVG element did you forget to add <svelte:options namespace=\"svg\"/> ?", "message": "<rect> is an SVG element did you forget to add <svelte:options namespace=\"svg\"/> ?",
"start": { "start": {
"line": 1, "line": 8,
"column": 0, "column": 0,
"character": 0 "character": 89
}, },
"end": { "end": {
"line": 1, "line": 8,
"column": 57, "column": 49,
"character": 57 "character": 138
}, },
"pos": 0 "pos": 89
}] }]

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

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

Loading…
Cancel
Save