fix indentation and remove unused variables (#5479)

pull/5484/head
Andreas Ehrencrona 4 years ago committed by GitHub
parent a28d776c06
commit e508fb7b8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,8 +12,8 @@ export function compare_node(a: Node | void, b: Node | void) {
compare_node(a.object, (b as MemberExpression).object) &&
compare_node(a.property, (b as MemberExpression).property) &&
a.computed === (b as MemberExpression).computed
);
case 'Literal':
return a.value === (b as Literal).value;
);
case 'Literal':
return a.value === (b as Literal).value;
}
}

@ -12,8 +12,8 @@ export function escape(data: string, { only_escape_at_symbol = false } = {}) {
}
const escaped = {
'"': '"',
"'": ''',
'"': '"',
"'": ''',
'&': '&',
'<': '&lt;',
'>': '&gt;'

@ -1,6 +1,6 @@
import * as assert from 'assert';
import * as fs from 'fs';
import { svelte, tryToLoadJson, shouldUpdateExpected } from '../helpers';
import { svelte, tryToLoadJson } from '../helpers';
describe('parse', () => {
fs.readdirSync(`${__dirname}/samples`).forEach(dir => {

@ -11,9 +11,8 @@ export default {
</div>
`,
test({ assert, component, target, window, raf }) {
test({ component, target }) {
const div = target.querySelector('div');
const { appendChild, insertBefore } = div;
div.appendChild = div.insertBefore = () => {
throw new Error('DOM was mutated');

@ -4,7 +4,6 @@ export default {
test({ assert, component, target }) {
container.div = null;
const top = component.top;
const div = target.querySelector('div');
component.visible = false;

@ -1,11 +1,11 @@
let subscribeCalled = false;
let unsubscribeCalled = false;
const fakeStore = val => ({
subscribe: cb => {
cb(val);
return {
unsubscribe: () => {
subscribeCalled = true;
unsubscribeCalled = true;
}
};
}
@ -22,6 +22,8 @@ export default {
async test({ assert, component, target }) {
component.foo = fakeStore(5);
return assert.htmlEqual(target.innerHTML, '<h1>5</h1>');
assert.htmlEqual(target.innerHTML, '<h1>5</h1>');
assert.ok(unsubscribeCalled);
}
};

@ -1,5 +1,5 @@
export default {
async test({ assert, component, target, window, raf }) {
async test({ assert, target, window }) {
const [_, btn] = target.querySelectorAll('button');
const clickEvent = new window.MouseEvent('click');

@ -1,9 +1,7 @@
let fulfil;
let reject;
const promise = new Promise((f, r) => {
const promise = new Promise((f) => {
fulfil = f;
reject = r;
});
export default {

Loading…
Cancel
Save