mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-20 18:17:51 +02:00
test: improve test coverage; multiple internal refactors (#6912)
This commit is contained in:
parent
12a7305238
commit
ad88f5cc87
78 changed files with 1613 additions and 1149 deletions
|
@ -40,7 +40,7 @@ function testStylelintRule(config, tests) {
|
|||
}
|
||||
const fixedOutput = await stylelint.lint({...options, fix: true});
|
||||
const fixedCode = getOutputCss(fixedOutput);
|
||||
expect(fixedCode).toBe(testCase.fixed);
|
||||
expect(fixedCode).toBe(testCase.code);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -113,22 +113,63 @@ testStylelintRule(
|
|||
},
|
||||
{
|
||||
ruleName,
|
||||
fix: false,
|
||||
fix: true,
|
||||
accept: [
|
||||
{
|
||||
code: `
|
||||
/**
|
||||
* Copyright
|
||||
*/
|
||||
.foo {}`,
|
||||
},
|
||||
{
|
||||
code: `/**
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
.foo {}`,
|
||||
.foo {}`,
|
||||
},
|
||||
{
|
||||
code: `/**
|
||||
* Copyright
|
||||
*/
|
||||
.foo {}`,
|
||||
},
|
||||
],
|
||||
reject: [
|
||||
{
|
||||
code: `.foo {}`,
|
||||
fixed: `/**
|
||||
* Copyright
|
||||
*/
|
||||
.foo {}`,
|
||||
message: messages.rejected,
|
||||
line: 1,
|
||||
column: 1,
|
||||
},
|
||||
{
|
||||
code: `
|
||||
/**
|
||||
* copyright
|
||||
.foo {}`,
|
||||
fixed: `/**
|
||||
* Copyright
|
||||
*/
|
||||
.foo {}`,
|
||||
message: messages.rejected,
|
||||
line: 1,
|
||||
column: 1,
|
||||
},
|
||||
{
|
||||
code: `/**
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
.foo {}`,
|
||||
fixed: `/**
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
/**
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
.foo {}`,
|
||||
|
@ -137,18 +178,37 @@ testStylelintRule(
|
|||
column: 1,
|
||||
},
|
||||
{
|
||||
code: `
|
||||
code: `/**
|
||||
* Copyleft
|
||||
*/
|
||||
|
||||
.foo {}`,
|
||||
fixed: `/**
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
/**
|
||||
* Copyleft
|
||||
*/
|
||||
|
||||
.foo {}`,
|
||||
.foo {}`,
|
||||
message: messages.rejected,
|
||||
line: 1,
|
||||
column: 1,
|
||||
},
|
||||
{
|
||||
code: `
|
||||
code: `/**
|
||||
* Copyleft
|
||||
*/
|
||||
|
||||
/**
|
||||
* Copyright
|
||||
*/
|
||||
.foo {}`,
|
||||
fixed: `/**
|
||||
* Copyright
|
||||
*/
|
||||
|
||||
/**
|
||||
* Copyleft
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue