Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test glob with parent directory #6398

Merged
merged 2 commits into from Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .prettierignore
Expand Up @@ -13,3 +13,5 @@
scripts/**/*.css
system-tests/**/*.css
system-tests/**/*.scss
# This unit test required a parent directory stucture and therefore is not inside /fixtures/globs
**/standalone-glob-parent-test/**/*.css
@@ -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 {}