Add tests for tabWiths option

master
Rogelio Guzman 2017-01-13 00:30:59 -06:00 committed by James Long
parent 7f9655e186
commit 63c87b6cd0
4 changed files with 129 additions and 0 deletions

View File

@ -0,0 +1,105 @@
exports[`test class.js 1`] = `
"class A {
method() {
var x = 1;
while(typeof x == \"number\" || typeof x == \"string\") {
x = x + 1;
if (true) x = \"\";
}
var z:number = x;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class A {
method() {
var x = 1;
while (typeof x == \"number\" || typeof x == \"string\") {
x = x + 1;
if (true)
x = \"\";
}
var z: number = x;
}
}
"
`;
exports[`test class.js 2`] = `
"class A {
method() {
var x = 1;
while(typeof x == \"number\" || typeof x == \"string\") {
x = x + 1;
if (true) x = \"\";
}
var z:number = x;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class A {
method() {
var x = 1;
while (typeof x == \"number\" || typeof x == \"string\") {
x = x + 1;
if (true)
x = \"\";
}
var z: number = x;
}
}
"
`;
exports[`test nested-functions.spec.js 1`] = `
"const c = () => {};
function a() {
return function b() {
return () => {
return function() {
return c;
}
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const c = () => {};
function a() {
return function b() {
return () => {
return function() {
return c;
};
};
};
}
"
`;
exports[`test nested-functions.spec.js 2`] = `
"const c = () => {};
function a() {
return function b() {
return () => {
return function() {
return c;
}
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const c = () => {};
function a() {
return function b() {
return () => {
return function() {
return c;
};
};
};
}
"
`;

10
tests/tabWith/class.js Normal file
View File

@ -0,0 +1,10 @@
class A {
method() {
var x = 1;
while(typeof x == "number" || typeof x == "string") {
x = x + 1;
if (true) x = "";
}
var z:number = x;
}
}

View File

@ -0,0 +1,3 @@
run_spec(__dirname);
run_spec(__dirname, { tabWidth: 4 });

View File

@ -0,0 +1,11 @@
const c = () => {};
function a() {
return function b() {
return () => {
return function() {
return c;
}
}
}
}