Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.

fix(core): Use `console.debug` verbosity in `debugExchange` (#3770)

Co-authored-by: Jeffrey Rooks <onx2rj@gmail.com>

authored by kitten.sh

Jeffrey Rooks and committed by
GitHub
48f433a4 53b822bc

+10 -5
+5
.changeset/serious-chefs-march.md
··· 1 + --- 2 + '@urql/core': patch 3 + --- 4 + 5 + Change debug log verbosity to `console.debug` rather than `console.log`
+3 -3
packages/core/src/exchanges/debug.test.ts
··· 29 29 }); 30 30 31 31 it('forwards query operations correctly', async () => { 32 - vi.spyOn(globalThis.console, 'log').mockImplementation(() => { 32 + vi.spyOn(globalThis.console, 'debug').mockImplementation(() => { 33 33 /** Do NOthing */ 34 34 }); 35 35 const { source: ops$, next, complete } = input; ··· 39 39 next(queryOperation); 40 40 complete(); 41 41 // eslint-disable-next-line no-console 42 - expect(console.log).toBeCalled(); 42 + expect(console.debug).toBeCalled(); 43 43 // eslint-disable-next-line no-console 44 - expect(console.log).toBeCalledTimes(2); 44 + expect(console.debug).toBeCalledTimes(2); 45 45 }); 46 46 47 47 describe('production', () => {
+2 -2
packages/core/src/exchanges/debug.ts
··· 23 23 pipe( 24 24 ops$, 25 25 // eslint-disable-next-line no-console 26 - tap(op => console.log('[Exchange debug]: Incoming operation: ', op)), 26 + tap(op => console.debug('[Exchange debug]: Incoming operation: ', op)), 27 27 forward, 28 28 tap(result => 29 29 // eslint-disable-next-line no-console 30 - console.log('[Exchange debug]: Completed operation: ', result) 30 + console.debug('[Exchange debug]: Completed operation: ', result) 31 31 ) 32 32 ); 33 33 }