Skip to content

Commit d779043

Browse files
committed
test(scope-maker): add scope-empty non-error tests
add tests for scope-empty rule with `disabled` and `warn` severity levels
1 parent a2c2593 commit d779043

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/prompts/scope-maker.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,20 @@ describe('scopeMaker', () => {
9494
});
9595
});
9696

97+
it('should allow skipping scope when "scope-empty" severity is "warn"', () => {
98+
const scopeConfig = choicesFactory({
99+
'scope-empty': [1, 'always', undefined]
100+
});
101+
102+
expect(scopeConfig).toContainEqual({ name: ':skip', value: '' });
103+
});
104+
105+
it('should allow skipping scope when "scope-empty" rule is not set', () => {
106+
const scopeConfig = choicesFactory({});
107+
108+
expect(scopeConfig).toContainEqual({ name: ':skip', value: '' });
109+
});
110+
97111
describe('filterFactory', () => {
98112
test.each<[Rule<Case>, string, string]>([
99113
[[Level.Error, 'always', 'camel-case'], 'FOO_BAR', 'fooBar'],

0 commit comments

Comments
 (0)