A Cypress plugin for caching data across tests, eliminating redundant API calls and improving test reliability. Current stable version is 1.0.26 (active development, frequent updates). Key differentiator: simple key-value cache within Cypress's task system, with TypeScript support. Compared to cy.fixtures or manual global variables, it provides a dedicated, typed cache mechanism with automatic cleanup between test suites.
npm install get-data-from-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the plugin in Cypress and demonstrates putting and getting data from cache across two tests.
Use Cypress 10, 11, or 12. Check peerDependencies in package.json.
Ensure put and get tasks are in the same describe block or use cy.writeFile/cy.readFile for suite-spanning data.
Check for empty string: `if (data !== '')` instead of truthiness checks.
Use require() in cypress.config.js/ts until Cypress natively supports ESM config.
Add `cachePlugin(on, config);` inside `setupNodeEvents` in cypress.config.ts.
Use `const cachePlugin = require('get-data-from-cache');` in CJS context.Ensure put and get tasks are in the same describe block.