Phase 1: Extract browser-compatible test detection to Common, move resolution to Core#79
Draft
Phase 1: Extract browser-compatible test detection to Common, move resolution to Core#79
Conversation
Co-authored-by: hawkeyexl <5209367+hawkeyexl@users.noreply.github.com>
- Created new detectTests.ts with browser-compatible parseContent function - Extracted pure parsing logic (no fs, path dependencies) - Added helper functions: parseXmlAttributes, parseObject, replaceNumericVariables - Updated common exports to include detectTests functionality - Successfully compiles with TypeScript strict mode Co-authored-by: hawkeyexl <5209367+hawkeyexl@users.noreply.github.com>
- Made crypto.randomUUID browser-compatible with fallbacks - Added detectTests() function as main entry point for test detection - Removed duplicate interface declarations - All 441 tests passing - Module compiles successfully with TypeScript strict mode Co-authored-by: hawkeyexl <5209367+hawkeyexl@users.noreply.github.com>
- Created resolveTests.js in core/src/ - Ported resolveDetectedTests, resolveSpec, resolveTest, resolveContext from resolver - Added resolveContexts and isDriverRequired helper functions - Updated Core's index.js to export resolveTests() - Module compiles and loads successfully Co-authored-by: hawkeyexl <5209367+hawkeyexl@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update common library for simpler architecture
Phase 1: Extract browser-compatible test detection to Common, move resolution to Core
Feb 4, 2026
- Add unit tests to verify the export of functions from the CommonJS and ESM modules. - Implement tests to ensure the `detectTests` function works correctly with both import styles. - Confirm that the results from `detectTests` are identical when using CJS and ESM. - Check for type definitions related to `detectTests` in the generated TypeScript declaration files. - Remove obsolete test files: `temp-element-timeout-test.json` and `temp-network-timeout-test.json`.
53c0ab09b update ignore ec3ad2154 Remove deprecated files and functions: - Delete `files.js`, `index.js`, `resolvePaths.js`, `schemas/index.js`, and `validate.js` as they are no longer needed. 49636115d Refactor code and improve logging functionality 2a41c1ebe Add tests for module exports and remove unused test files 5c75d1844 feat: make Common module browser-compatible a873eefd3 feat: add browser-compatible detectTests module to common bac81c1ee Initial exploration of Phase 1 consolidation task git-subtree-dir: common git-subtree-split: 53c0ab09ba1963fc8db19234252c4036b5a1297f
…dencies - Remove the `readFile` function and its associated tests from the codebase. - Delete the `resolvePaths` function and its related tests. - Update `package.json` to remove `axios` from dependencies and add `@apidevtools/json-schema-ref-parser` to devDependencies. - Adjust exports in `index.ts` to remove deprecated functions. - Update tests to reflect changes in exports and remove tests for deleted functions.
- Upgrade dependencies in package.json for improved functionality and security. - Add a deepMerge function to handle configuration overrides more effectively. - Introduce resolveConcurrentRunners to manage concurrent execution settings. - Implement detectTests function to identify and parse test specifications from files. - Create files.js to handle reading and parsing of JSON and YAML files. - Enhance error handling and logging throughout the configuration and test detection processes. - Add support for DITA file types and improve path resolution for configuration properties. - Refactor index.js to include new detectTests and readFile functionalities.
- Clamp rectangle values to ensure they stay within image bounds in saveScreenshot function. - Improve cleanup logic by checking if temporary files exist before deletion. - Update server start logic to handle cases where the server is already running. - Set maxVariation to 0 for more precise screenshot comparisons. - Add assertions to verify the creation of initial screenshot files.
- Change dependencies for `doc-detective-common` and `doc-detective-core` to local file paths. - Update the `saveScreenshot` function to await the `sharp` processing for cropping images. - Remove the retry logic for checking if the cropped image file exists after processing. - Ensure the output of the `sharp` processing is in PNG format for both images being resized.
- Add tests to normalize logLevel configurations in the log function - Implement tests to ensure messages are not logged when logLevel is set to silent - Add tests to skip detected steps inside ignore blocks in markdown content - Use structuredClone for test input in integration tests to prevent mutation
- Upgrade axios to version 1.13.5 - Update doc-detective-common to version 4.0.0-beta.0 - Upgrade body-parser to version 2.2.2 - Upgrade chai to version 6.2.2 - Update posthog-node to version 5.24.15 - Change version of doc-detective-core to 4.0.0-beta.0
- Create a test suite for the upload module, including tests for collecting changed files, integration configuration retrieval, and uploader functionality. - Implement a drag-and-drop test HTML file to demonstrate widget dragging and dropping into designated zones. - Add an enhanced elements test HTML file to showcase various button and input elements with different attributes and accessibility features. - Create multiple HTML files to test DOM mutations, including scenarios for immediate and delayed mutations, as well as continuous network requests. - Include a static HTML page to serve as a baseline for testing static content loading.
…r CJS format - Add a banner to set importMetaUrl for compatibility
…- Change version from 3.6.3 to 4.0.0-beta.0 - Modify postinstall script to disable warning DEP0190 - Update import statements in postinstall.js to use namespace imports
… import path for testsModule in getRunner() function to use the dist directory - Delete temp-screenshot-regression-test.json as it is no longer needed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidating resolver functionality into Common and Core to simplify architecture. Common becomes browser-compatible; resolver will be deprecated.
Changes
Common: Browser-Compatible Test Detection
detectTests.ts: Extracted pure parsing logic (parseContent) from resolverparseXmlAttributes,parseObject,replaceNumericVariablesrandomUUIDwith Web Crypto API + Node.js fallbacksdetectTests()(temporary: keptfiles.tsandresolvePaths.tsfor backwards compatibility)Core: Test Resolution Logic
resolveTests.js: Complete resolution pipeline from resolverresolveDetectedTests,resolveSpec,resolveTest,resolveContextresolveTests()to public APIStatus
✅ Common: 441/441 tests passing
⚠️ Still depends on resolver (breaking change deferred to Phase 2)
Next Steps
qualifyFiles,parseTests) to Corefiles.ts/resolvePaths.tsfrom Common exportsOriginal prompt
Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.