[go: nahoru, domu]

Skip to content

Commit

Permalink
test: ignoring folder/files, issue #317
Browse files Browse the repository at this point in the history
  • Loading branch information
Scrum committed Aug 19, 2020
1 parent 1b7b04c commit 7a4e8dc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/expected/output-ignoring/input.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>input-nesting-index</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>input-nesting-child/index</div>
1 change: 1 addition & 0 deletions test/fixtures/input-ignoring/input.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>input-nesting-index</div>
21 changes: 21 additions & 0 deletions test/test-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,24 @@ test('Specify the root of the output folder structure with root option', async t
(await read(`${outputPath}/input-nesting-child/input-nesting.html`))
);
});

test('Ignoring files by pattern', async t => {
const outputPath = 'test/expected/output-ignoring';
rimraf.sync(outputPath);
t.plan(3);
await execa(cli, [
'**/*.html',
'!ignoring-input-child/**/*.html',
'-o',
outputPath,
'-a',
'-r',
'test/fixtures/input-ignoring'
]);
t.true(await pathExists(outputPath));
t.is(
(await read('test/fixtures/input-ignoring/input.html')),
(await read(`${outputPath}/input.html`))
);
t.false(await pathExists('test/expected/input-ignoring/ignoring-input-child'));
});

0 comments on commit 7a4e8dc

Please sign in to comment.