The `find-test-names-tags` package, currently at stable version 1.0.4, is a utility designed for parsing JavaScript test files, specifically those written for Mocha and Cypress frameworks. Its primary function is to extract comprehensive information about test suites and individual test cases, including their names and any associated tags. A significant feature is its ability to compute "effective tags" for each test, which involves aggregating tags from the test itself and its parent suites. This allows for powerful filtering capabilities, enabling users to isolate tests based on specific tags or combinations thereof. The package also provides command-line interfaces for printing structured test outlines, including marking pending tests and displaying their tags. While a precise release cadence isn't specified, the package appears to be actively maintained and developed. It stands out by offering fine-grained control over test metadata extraction and analysis, making it valuable for dynamic test reporting, selective test execution in CI/CD pipelines, or building custom test dashboards. It effectively bridges the gap between raw test code and actionable test metadata.
npm install find-test-names-tagsVerified import paths — ran on the pinned version, not inferred.
Demonstrates parsing a mock spec file, retrieving the full test structure, computing effective tags for tests, and then filtering these tests based on specific tag criteria.
This is expected behavior and not an error. If exact variable-defined names are critical, ensure test names are always literal strings where possible.
Always call `getTestNames(sourceCode, true)` when you intend to work with the full `result.structure` for advanced tag processing.
Ensure you call `const result = getTestNames(specSourceCode, true)` to correctly populate the `structure` property.
Use the CommonJS destructuring assignment: `const { getTestNames } = require('find-test-names-tags')`.No dependency data recorded yet.