{"repo":"zendesk/laika","free":true,"listed":false,"github":"https://github.com/zendesk/laika","clone":"git clone https://github.com/zendesk/laika.git","description":"Log, test, intercept and modify Apollo Client's operations","language":"TypeScript","stars":124,"topics":["apollo","apollo-client","graphql","mock","testing","utility","apollo-link","mocking","test","testing-tools"],"license":"Apache-2.0","category":"dev-tools","readme_excerpt":"Test, mock, intercept and modify Apollo Client's operations — in both browser and unit tests! Read the Medium article about Laika: Mock GraphQL Subscriptions with Laika — the only Apollo Client mocking tool you’ll need Features - mock responses in either unit tests or browser tests (think Playwright, Puppeteer or Cypress) - simulate error state - simulate loading state - simulate subscriptions (pushing data to the client at any given point) - it can work in production code without affecting the size of the bundle (laika is lazily loaded) - captures the variables that were called for a given operation for assertions - log all the data passing through from the network (or whatever Links are after this one) - record your user story - generate fixtures and working mock code for use in your tests - modify backend responses before they reach your components (e.g. to fuzz-test unexpected behavior) Usage - Peer support: @apollo/client =3.2.5 <5 , graphql ^15 ^16 , and rxjs ^7.3.0 for Apollo Client 4.x projects - How to install - Conditionally loading Laika - Testing approach - Usage in Playwright - Usage in Jest / Vitest - Usage in Cypress - Advanced usage - Resetting Between Tests - Logging and recording - Pitfalls - API reference Alternatives - MockedProvider - the official Apollo mocking tool designed for unit tests; offers no subscription mocking or recording functionality Contribution Thanks for your interest in our tool! Community involvement helps make our design system fresh ","default_branch":null,"files":null,"tree":[],"storefront":"/r/zendesk","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/zendesk/laika/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}