File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
packages/plugin/__tests__ Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff 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+ `;
Original file line number Diff line number Diff 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
126133function testESLintOutput ( cwd : string , errorCount : number ) : void {
You can’t perform that action at this time.
0 commit comments