Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
nebrelbug committed Sep 21, 2020
1 parent ccac9f7 commit 2b27782
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/compile-string.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const complexTemplate = fs.readFileSync(filePath, 'utf8')
describe('Compile to String test', () => {
it('parses a simple template', () => {
var str = compileToString('hi <%= hey %>', defaultConfig)
expect(str).toEqual(`var tR='',__l,__lP,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
expect(str)
.toEqual(`var tR='',__l,__lP,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
function layout(p,d){__l=p;__lP=d}
tR+='hi '
tR+=E.e(hey)
Expand All @@ -32,7 +33,8 @@ if(cb){cb(null,tR)} return tR`)

it('parses a simple template with raw tag', () => {
var str = compileToString('hi <%~ hey %>', defaultConfig)
expect(str).toEqual(`var tR='',__l,__lP,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
expect(str)
.toEqual(`var tR='',__l,__lP,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
function layout(p,d){__l=p;__lP=d}
tR+='hi '
tR+=hey
Expand All @@ -42,7 +44,8 @@ if(cb){cb(null,tR)} return tR`)

it('works with whitespace trimming', () => {
var str = compileToString('hi\n<%- = hey-%>\n<%_ = hi_%>', defaultConfig)
expect(str).toEqual(`var tR='',__l,__lP,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
expect(str)
.toEqual(`var tR='',__l,__lP,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
function layout(p,d){__l=p;__lP=d}
tR+='hi'
tR+=E.e(hey)
Expand Down

0 comments on commit 2b27782

Please sign in to comment.