Add tests for bracketSpacing option

master
Rogelio Guzman 2017-01-13 00:30:18 -06:00 committed by James Long
parent 3e0ac6c18e
commit e54b9806a3
4 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,35 @@
exports[`test array.js 1`] = `
"const arr1 = [1,2,3,4];
const arr2 = [1, 2, 3, 4];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const arr1 = [ 1, 2, 3, 4 ];
const arr2 = [ 1, 2, 3, 4 ];
"
`;
exports[`test array.js 2`] = `
"const arr1 = [1,2,3,4];
const arr2 = [1, 2, 3, 4];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const arr1 = [1, 2, 3, 4];
const arr2 = [1, 2, 3, 4];
"
`;
exports[`test object.js 1`] = `
"const obj1 = {a:1, b:2, c:3}
const obj2 = { a:1, b:2, c:3 };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const obj1 = { a: 1, b: 2, c: 3 };
const obj2 = { a: 1, b: 2, c: 3 };
"
`;
exports[`test object.js 2`] = `
"const obj1 = {a:1, b:2, c:3}
const obj2 = { a:1, b:2, c:3 };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const obj1 = {a: 1, b: 2, c: 3};
const obj2 = {a: 1, b: 2, c: 3};
"
`;

View File

@ -0,0 +1,2 @@
const arr1 = [1,2,3,4];
const arr2 = [1, 2, 3, 4];

View File

@ -0,0 +1,3 @@
run_spec(__dirname);
run_spec(__dirname, { bracketSpacing: false });

View File

@ -0,0 +1,2 @@
const obj1 = {a:1, b:2, c:3}
const obj2 = { a:1, b:2, c:3 };