Skip to content

Commit 7c6ea13

Browse files
committed
reenable all tests, fix some failures
1 parent 85e9ed9 commit 7c6ea13

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/generators/dom/visitors/Element/Element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default function visitElement(
102102

103103
if (node._cssRefAttribute) {
104104
block.builders.hydrate.addLine(
105-
`@setAttribute(${name}, "svelte-ref-${node._cssRefAttribute}", ");`
105+
`@setAttribute(${name}, "svelte-ref-${node._cssRefAttribute}", "");`
106106
)
107107
}
108108
}

test/css/index.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import assert from 'assert';
22
import * as fs from 'fs';
3-
import { env, normalizeHtml, svelte } from '../helpers.js';
3+
import { parse } from 'acorn';
4+
import { addLineNumbers, env, normalizeHtml, svelte } from '../helpers.js';
45

56
function tryRequire(file) {
67
try {
@@ -22,6 +23,15 @@ function normalizeWarning(warning) {
2223
return warning;
2324
}
2425

26+
function checkCodeIsValid(code) {
27+
try {
28+
parse(code);
29+
} catch (err) {
30+
console.error(addLineNumbers(code));
31+
throw new Error(err.message);
32+
}
33+
}
34+
2535
describe('css', () => {
2636
fs.readdirSync('test/css/samples').forEach(dir => {
2737
if (dir[0] === '.') return;
@@ -67,6 +77,10 @@ describe('css', () => {
6777
})
6878
);
6979

80+
// check the code is valid
81+
checkCodeIsValid(dom.code);
82+
checkCodeIsValid(ssr.code);
83+
7084
assert.equal(dom.css, ssr.css);
7185

7286
assert.deepEqual(

test/validator/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from "fs";
22
import assert from "assert";
33
import { svelte, tryToLoadJson } from "../helpers.js";
44

5-
describe.only("validate", () => {
5+
describe("validate", () => {
66
fs.readdirSync("test/validator/samples").forEach(dir => {
77
if (dir[0] === ".") return;
88

0 commit comments

Comments
 (0)