Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
nebrelbug committed Sep 17, 2020
1 parent 5c2fda2 commit 0301578
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/compile-string.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ 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,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
expect(str).toEqual(`var tR='',l,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
function layout(p){l=p}
tR+='hi '
tR+=E.e(hey)
Expand All @@ -33,8 +32,7 @@ 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,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
expect(str).toEqual(`var tR='',l,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
function layout(p){l=p}
tR+='hi '
tR+=hey
Expand All @@ -44,8 +42,7 @@ 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,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
expect(str).toEqual(`var tR='',l,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
function layout(p){l=p}
tR+='hi'
tR+=E.e(hey)
Expand Down

0 comments on commit 0301578

Please sign in to comment.