-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Christopher Quadflieg
committed
Nov 16, 2019
1 parent
94fdc0c
commit 194f103
Showing
5 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
body | ||
foo | ||
foo(bar="baz") | ||
foo/ | ||
foo(bar="baz")/ | ||
foo / | ||
foo(bar="baz") / | ||
#{'foo'}/ | ||
#{'foo'}(bar="baz")/ | ||
#{'foo'}/ | ||
#{'foo'}(bar="baz") / | ||
//- can have a single space after them | ||
img | ||
//- can have lots of white space after them | ||
img | ||
#{ | ||
'foo' | ||
}/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { readFileSync } from 'fs'; | ||
import { resolve } from 'path'; | ||
import { format } from 'prettier'; | ||
import { plugin } from './../../src/index'; | ||
|
||
describe('Slash', () => { | ||
test('should handle slash token', () => { | ||
const expected: string = readFileSync(resolve(__dirname, 'formatted.pug'), 'utf8'); | ||
const code: string = readFileSync(resolve(__dirname, 'unformatted.pug'), 'utf8'); | ||
const actual: string = format(code, { parser: 'pug' as any, plugins: [plugin] }); | ||
|
||
expect(actual).toBe(expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
body | ||
foo | ||
foo(bar='baz') | ||
foo/ | ||
foo(bar='baz')/ | ||
foo / | ||
foo(bar='baz') / | ||
#{'foo'}/ | ||
#{'foo'}(bar='baz')/ | ||
#{'foo'} / | ||
#{'foo'}(bar='baz') / | ||
//- can have a single space after them | ||
img | ||
//- can have lots of white space after them | ||
img | ||
#{ | ||
'foo' | ||
}/ |