Skip to content

Commit

Permalink
Add unit tests that have globs with a parent directory ('../style.css…
Browse files Browse the repository at this point in the history
…') and paren + wildcard directory ('../**/style.css')
  • Loading branch information
sjarva committed Oct 8, 2022
1 parent 168b71a commit f2079e5
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
@@ -0,0 +1,20 @@
'use strict';

const standalone = require('../../../../standalone');

it('glob contains a parent directory and ** wildcard', async () => {
const { results } = await standalone({
files: '../**/sibling-style.css',
config: { rules: { 'block-no-empty': true } },
cwd: __dirname,
});

expect(results).toHaveLength(1);
expect(results[0].errored).toBe(true);
expect(results[0].warnings[0]).toEqual(
expect.objectContaining({
rule: 'block-no-empty',
severity: 'error',
}),
);
});
@@ -0,0 +1 @@
a {}
@@ -0,0 +1,20 @@
'use strict';

const standalone = require('../../../standalone');

it('glob has parent directory', async () => {
const { results } = await standalone({
files: '../parent-folder-style.css',
config: { rules: { 'block-no-empty': true } },
cwd: __dirname,
});

expect(results).toHaveLength(1);
expect(results[0].errored).toBe(true);
expect(results[0].warnings[0]).toEqual(
expect.objectContaining({
rule: 'block-no-empty',
severity: 'error',
}),
);
});
@@ -0,0 +1 @@
a {}

0 comments on commit f2079e5

Please sign in to comment.