Skip to content

Commit 1dac470

Browse files
committed
test: skip by pattern
1 parent 70902c0 commit 1dac470

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

test/config/.config-skip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
'root': 'test/fixtures/input-skip',
23
'skip': 'input-skip.html'
34
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
'root': 'test/fixtures',
3+
'skip': '**/input-skip-by-pattern.html'
4+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<custome-element>input-skip-skip</custome-element>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div>input-skip-index</div>

test/test-cfg-resolve.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,17 @@ test('should return config when skip param from config', t => {
143143
config: 'test/config/.config-skip'
144144
};
145145
const config = cfgResolve({input, flags});
146-
const expected = [normalizePath(path.resolve('input-skip.html'))];
146+
const expected = [normalizePath(path.join(path.resolve('test/fixtures/input-skip/'), 'input-skip.html'))];
147+
t.deepEqual(config.skip, expected);
148+
});
149+
150+
test('should return config when skip param from config by pattern', t => {
151+
const input = 'input.html';
152+
const flags = {
153+
config: 'test/config/.config-skip-by-pattern'
154+
};
155+
const config = cfgResolve({input, flags});
156+
const expected = [normalizePath(path.join(path.resolve('test/fixtures/input-skip-by-pattern/'), 'input-skip-by-pattern.html'))];
147157
t.deepEqual(config.skip, expected);
148158
});
149159

0 commit comments

Comments
 (0)