@@ -158,7 +158,7 @@ describe('recommended config', () => {
158158
159159 const results = await cli . lintText ( `
160160 import { wire } from 'lwc';
161- import { gql, graphql } from 'lightning/uiGraphQLApi ';
161+ import { gql, graphql } from 'lightning/graphql ';
162162
163163 class Test {
164164 @wire(graphql, {})
@@ -172,6 +172,23 @@ describe('recommended config', () => {
172172 '@lwc/lwc/valid-graphql-wire-adapter-callback-parameters' ,
173173 ) ;
174174 } ) ;
175+
176+ it ( 'should suggest upgrading to new versions of libraries' , async ( ) => {
177+ const cli = getCliEngineWithRecommendedRules ( ) ;
178+
179+ const results = await cli . lintText ( `
180+ import { wire } from 'lwc';
181+ import { gql, graphql } from 'lightning/uiGraphQLApi';
182+
183+ class Test {
184+ @wire(graphql, {})
185+ wiredMethod({errors, data}) {}
186+ }` ) ;
187+
188+ const { messages } = results [ 0 ] ;
189+ assert . strictEqual ( messages . length , 5 ) ;
190+ assert . strictEqual ( messages [ 0 ] . ruleId , '@lwc/lwc/newer-version-available' ) ;
191+ } ) ;
175192} ) ;
176193
177194describe ( 'typescript recommended config' , ( ) => {
@@ -310,7 +327,7 @@ describe('typescript recommended config', () => {
310327
311328 const results = await cli . lintText ( `
312329 import { wire } from 'lwc';
313- import { gql, graphql } from 'lightning/uiGraphQLApi ';
330+ import { gql, graphql } from 'lightning/graphql ';
314331
315332 class Test {
316333 @wire(graphql, {})
0 commit comments