Skip to content

Commit

Permalink
chore: add test for typescript file relates: #143
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimr committed Oct 23, 2018
1 parent 61ff1e3 commit 7c58656
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions t/issue_143.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
let $HOME = fnamemodify(expand("<sfile>"), ":h")
filetype plugin on
let g:editorconfig_Beautifier = 't/issue_143/.editorconfig'
runtime! plugin/beautifier.vim

describe 'issue_143'
before
new
end

after
close!
end


it 'should format typescript file'
setfiletype typescript
read `='t/issue_143/file.ts'`
Expect JsBeautify() == join(readfile('t/issue_143/expected'), "\n")
end
end
8 changes: 8 additions & 0 deletions t/issue_143/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[**.js]
charset = utf-8
indent_style = space
indent_size = 3
insert_final_newline = true
trim_trailing_whitespace = true
8 changes: 8 additions & 0 deletions t/issue_143/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function greeter(person: string) {
return "Hello, " + person;
}

let user = "Jane User";

document.body.innerHTML = greeter(user);

5 changes: 5 additions & 0 deletions t/issue_143/file.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function greeter(person: string) { return "Hello, " + person; }

let user = "Jane User";

document.body.innerHTML = greeter(user);

0 comments on commit 7c58656

Please sign in to comment.