Skip to content

Commit

Permalink
test: normnalize new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Oct 5, 2020
1 parent 00dac4c commit 931938c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion npm-audit.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h5 class="card-title">
<div class="card">
<div class="card-body">
<h5 class="card-title">
October 5th 2020, 10:38:25 am
October 5th 2020, 10:48:29 am
</h5>
<p class="card-text">Last updated</p>
</div>
Expand Down
37 changes: 20 additions & 17 deletions test/filename.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ import dedent from 'dedent-js'
import { Filesystem } from '@poppinss/dev-utils'

import { Edge } from '../src/Edge'
import { normalizeNewLines } from '../test-helpers'

import './assert-extend'

const fs = new Filesystem(join(__dirname, 'views'))

test.group('Template', (group) => {
test.group('Template FileName', (group) => {
group.afterEach(async () => {
await fs.cleanup()
})
Expand Down Expand Up @@ -46,12 +49,12 @@ test.group('Template', (group) => {

const output = edge.render('foo', {})

assert.equal(
assert.stringEqual(
output.trim(),
dedent`
${join(fs.basePath, 'bar.edge')}
${join(fs.basePath, 'foo.edge')}
`
normalizeNewLines(dedent`
${join(fs.basePath, 'bar.edge')}
${join(fs.basePath, 'foo.edge')}
`)
)
})

Expand Down Expand Up @@ -81,12 +84,12 @@ test.group('Template', (group) => {

const output = edge.render('foo', {})

assert.equal(
assert.stringEqual(
output.trim(),
dedent`
normalizeNewLines(dedent`
${join(fs.basePath, 'master.edge')}
${join(fs.basePath, 'foo.edge')}
`
`)
)
})

Expand All @@ -105,12 +108,12 @@ test.group('Template', (group) => {

const output = edge.render('foo', {})

assert.equal(
assert.stringEqual(
output.trim(),
dedent`
${join(fs.basePath, 'bar.edge')}
${join(fs.basePath, 'foo.edge')}
`
normalizeNewLines(dedent`
${join(fs.basePath, 'bar.edge')}
${join(fs.basePath, 'foo.edge')}
`)
)
})

Expand Down Expand Up @@ -139,12 +142,12 @@ test.group('Template', (group) => {

const output = edge.render('foo', {})

assert.equal(
assert.stringEqual(
output.trim(),
dedent`
normalizeNewLines(dedent`
${join(fs.basePath, 'foo.edge')}
${join(fs.basePath, 'button.edge')}
`
`)
)
})
})

0 comments on commit 931938c

Please sign in to comment.