regexpu-fixtures

raw JSON →
2.1.6 verified Fri May 01 auth: no javascript maintenance

Test fixtures (test cases) for the regexpu project, which transpiles ES2015 Unicode regular expressions to ES5. Version 2.1.6 is stable. The package contains JSON data used by regexpu's test suite and may be reused by other JavaScript regex tools. No active development since the last release. Differentiator: provides a comprehensive set of test cases for Unicode-aware regex transpilation.

error Cannot find module 'regexpu-fixtures'
cause Importing the package without specifying a JSON file path.
fix
Import a specific file: import data from 'regexpu-fixtures/data.json' assert { type: 'json' };
gotcha No default export from the package; you must import JSON files by their full path with extension.
fix Use import with path to .json file and assert type (ESM) or require with .json extension (CJS).
npm install regexpu-fixtures
yarn add regexpu-fixtures
pnpm add regexpu-fixtures

Shows how to import and inspect the test fixture data from regexpu-fixtures.

import data from 'regexpu-fixtures/data.json' assert { type: 'json' };
console.log(Object.keys(data)); // List of fixture categories
// Access specific test cases
const es5fixtures = data['es5-fixtures'];
console.log(es5fixtures.length); // Number of test cases