Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Add test case for #152
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Nov 20, 2018
1 parent 265cb8f commit 28a864b
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions tests/lib/rules/type-annotation-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -3380,6 +3380,71 @@ type Foo = {
column: 26
}
]
},
// https://github.com/bradzacher/eslint-plugin-typescript/issues/152
{
code: `
class Some {
a : {some: string, other: {more: number}};
someMethod : (args : {some: string, other: {more: number}}) => void;
doSomething(args : {some: string, other: {more: number}}) : void {}
}
`,
options: [{ after: true, before: true }],
output: `
class Some {
a : {some : string, other : {more : number}};
someMethod : (args : {some : string, other : {more : number}}) => void;
doSomething(args : {some : string, other : {more : number}}) : void {}
}
`,
errors: [
{
message: `Expected a space before the ':'`,
line: 3,
column: 30
},
{
message: `Expected a space before the ':'`,
line: 3,
column: 45
},
{
message: `Expected a space before the ':'`,
line: 3,
column: 52
},
{
message: `Expected a space before the ':'`,
line: 4,
column: 47
},
{
message: `Expected a space before the ':'`,
line: 4,
column: 62
},
{
message: `Expected a space before the ':'`,
line: 4,
column: 69
},
{
message: `Expected a space before the ':'`,
line: 5,
column: 45
},
{
message: `Expected a space before the ':'`,
line: 5,
column: 60
},
{
message: `Expected a space before the ':'`,
line: 5,
column: 67
}
]
}
]
});
Expand Down

0 comments on commit 28a864b

Please sign in to comment.