Skip to content

Commit

Permalink
check result.error vs result.output, fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kyledurand committed Jul 3, 2024
1 parent 34c8b65 commit a2f3600
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions packages/stylelint-plugin/tests/config-e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,23 @@ describe('stylelint-plugin E2E Tests', () => {
const result = runStylelint('value-keyword-case.*.scss');

const expectedResult = `
Deprecation warnings:
- The "scss/at-import-no-partial-leading-underscore" rule is deprecated.
- 'at-import-no-partial-leading-underscore' has been deprecated, and will be removed in '7.0'. Use 'load-no-partial-leading-underscore' instead. See: https://github.com/stylelint-scss/stylelint-scss/blob/v5.2.1/src/rules/at-import-no-partial-leading-underscore/README.md
- The "scss/at-import-partial-extension-blacklist" rule is deprecated.
- 'at-import-partial-extension-blacklist' has been deprecated, and will be removed in '7.0'. Use 'at-import-partial-extension-disallowed-list' instead. See: https://github.com/stylelint-scss/stylelint-scss/blob/v6.1.0/src/rules/at-import-partial-extension-blacklist/README.md
value-keyword-case.invalid.scss
1:7 ✖ Expected "Value" to be "value" value-keyword-case
2:7 ✖ Expected "VALUE" to be "value" value-keyword-case
5:10 ✖ Expected "Monaco" to be "monaco" value-keyword-case
6:18 ✖ Expected "Monaco" to be "monaco" value-keyword-case
1:7 ✖ Expected "Value" to be "value" value-keyword-case
2:7 ✖ Expected "VALUE" to be "value" value-keyword-case
5:10 ✖ Expected "Monaco" to be "monaco" value-keyword-case
6:18 ✖ Expected "Monaco" to be "monaco" value-keyword-case
4 problems (4 errors, 0 warnings)
`.trim();
✖ 4 problems (4 errors, 0 warnings)
4 errors potentially fixable with the "--fix" option.
`.trim();

expect(result.output).toStrictEqual(expectedResult);
expect(result.error).toStrictEqual(expectedResult);
expect(result.status).toBe(2);
});

Expand All @@ -35,16 +42,22 @@ value-keyword-case.invalid.scss
// trailing whitespace and editors really want to remove that trailing
// whitespace when saving the file
const expectedResult = `
Deprecation warnings:
- The "scss/at-import-no-partial-leading-underscore" rule is deprecated.
- 'at-import-no-partial-leading-underscore' has been deprecated, and will be removed in '7.0'. Use 'load-no-partial-leading-underscore' instead. See: https://github.com/stylelint-scss/stylelint-scss/blob/v5.2.1/src/rules/at-import-no-partial-leading-underscore/README.md
- The "scss/at-import-partial-extension-blacklist" rule is deprecated.
- 'at-import-partial-extension-blacklist' has been deprecated, and will be removed in '7.0'. Use 'at-import-partial-extension-disallowed-list' instead. See: https://github.com/stylelint-scss/stylelint-scss/blob/v6.1.0/src/rules/at-import-partial-extension-blacklist/README.md
scss.invalid.scss
6:5 ✖ Expected ".n1 .n2 .n3" to have no more than 2 classes selector-max-class
6:5 ✖ Expected ".n1 .n2 .n3" to have no more than 1 combinator selector-max-combinators
16:20 ✖ Expected "$value * 1px" instead of "#{$value}px". Consider writing "value" in terms of px originally. scss/dimension-no-non-numeric-values
22:3 ✖ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name
6:5 ✖ Expected ".n3" to have no more than 2 classes selector-max-class
6:5 ✖ Expected ".n3" to have no more than 1 combinator selector-max-combinators
16:12 ✖ Expected "$value * 1px" instead of "#{$value}px". Consider writing "value" in terms of px originally. scss/dimension-no-non-numeric-values
22:3 ✖ Unexpected union class name with the parent selector (&) scss/selector-no-union-class-name
4 problems (4 errors, 0 warnings)
`.trim();
4 problems (4 errors, 0 warnings)
`.trim();

expect(result.output).toStrictEqual(expectedResult);
expect(result.error).toStrictEqual(expectedResult);
expect(result.status).toBe(2);
});
});
Expand Down

0 comments on commit a2f3600

Please sign in to comment.