Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add failing test case for duplicate block
[see #2367]
- Loading branch information
1 parent
298d87d
commit d91bab7
Showing
6 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
packages/pug/test/duplicate-block/__snapshots__/index.test.js.snap
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,3 @@ | ||
exports[`test layout with duplicate block 1`] = `"<div>Hello World</div>"`; | ||
|
||
exports[`test layout with duplicate block 2`] = `"<!DOCTYPE html><html><head></head><body><div>Hello World</div></body></html>"`; |
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,4 @@ | ||
extends ./layout-with-duplicate-block.pug | ||
|
||
block content | ||
div Hello World |
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 @@ | ||
const pug = require('../../'); | ||
|
||
test('layout with duplicate block', () => { | ||
const outputWithAjax = pug.renderFile( | ||
__dirname + '/index.pug', | ||
{ajax: true} | ||
); | ||
const outputWithoutAjax = pug.renderFile( | ||
__dirname + '/index.pug', | ||
{ajax: false} | ||
); | ||
expect(outputWithAjax).toMatchSnapshot(); | ||
expect(outputWithoutAjax).toMatchSnapshot(); | ||
}); |
8 changes: 8 additions & 0 deletions
8
packages/pug/test/duplicate-block/layout-with-duplicate-block.pug
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,8 @@ | ||
if ajax | ||
block content | ||
else | ||
doctype html | ||
html | ||
head | ||
body | ||
block content |