reenable all tests, fix some failures

pull/815/head
Rich Harris 7 years ago
parent 85e9ed9a81
commit 7c6ea13689

@ -102,7 +102,7 @@ export default function visitElement(
if (node._cssRefAttribute) {
block.builders.hydrate.addLine(
`@setAttribute(${name}, "svelte-ref-${node._cssRefAttribute}", ");`
`@setAttribute(${name}, "svelte-ref-${node._cssRefAttribute}", "");`
)
}
}

@ -1,6 +1,7 @@
import assert from 'assert';
import * as fs from 'fs';
import { env, normalizeHtml, svelte } from '../helpers.js';
import { parse } from 'acorn';
import { addLineNumbers, env, normalizeHtml, svelte } from '../helpers.js';
function tryRequire(file) {
try {
@ -22,6 +23,15 @@ function normalizeWarning(warning) {
return warning;
}
function checkCodeIsValid(code) {
try {
parse(code);
} catch (err) {
console.error(addLineNumbers(code));
throw new Error(err.message);
}
}
describe('css', () => {
fs.readdirSync('test/css/samples').forEach(dir => {
if (dir[0] === '.') return;
@ -67,6 +77,10 @@ describe('css', () => {
})
);
// check the code is valid
checkCodeIsValid(dom.code);
checkCodeIsValid(ssr.code);
assert.equal(dom.css, ssr.css);
assert.deepEqual(

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

Loading…
Cancel
Save