Skip to content

Commit 394d8ed

Browse files
committed
aa
1 parent d2f1164 commit 394d8ed

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

packages/plugin/__tests__/__snapshots__/examples.spec.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,3 +2133,23 @@ exports[`Examples > should work with \`graphql-config\` 2`] = `
21332133
},
21342134
]
21352135
`;
2136+
2137+
exports[`Examples > should work with custom rules 1`] = `
2138+
[
2139+
{
2140+
filePath: examples/custom-rule/test.graphql,
2141+
messages: [
2142+
{
2143+
column: 1,
2144+
endColumn: 13,
2145+
endLine: 1,
2146+
line: 1,
2147+
message: Oops, name is required!,
2148+
nodeType: OperationDefinition,
2149+
ruleId: @internal/my-rule,
2150+
severity: 2,
2151+
},
2152+
],
2153+
},
2154+
]
2155+
`;

packages/plugin/__tests__/examples.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ describe('Examples', () => {
121121
const cwd = path.join(CWD, 'examples', 'multiple-projects-graphql-config');
122122
testESLintOutput(cwd, 4);
123123
});
124+
125+
it('should work with custom rules', () => {
126+
const cwd = path.join(CWD, 'examples', 'custom-rule');
127+
const flatResults = getFlatESLintOutput(cwd);
128+
expect(normalizeResults(flatResults)).toMatchSnapshot();
129+
expect(countErrors(flatResults)).toBe(1);
130+
})
124131
});
125132

126133
function testESLintOutput(cwd: string, errorCount: number): void {

0 commit comments

Comments
 (0)