Add support for TypeScript-only adapters in integration tests#695
Merged
Add support for TypeScript-only adapters in integration tests#695
Conversation
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add TypeScript support for testing adapters
Add support for TypeScript-only adapters in integration tests
Nov 8, 2025
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Contributor
Author
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Collaborator
|
@copilot Please re-add the build files because we also submit them. Add this to your instructions too that the files are needed |
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Contributor
Author
Apollon77
approved these changes
Nov 8, 2025
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Contributor
Author
Apollon77
approved these changes
Nov 8, 2025
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.
Summary: Add TypeScript Support to Testing Library
This PR successfully adds support for testing ioBroker adapters that use TypeScript files directly as their main entry point (e.g.,
src/main.tsin package.json) without transpiling to JavaScript.✅ All Changes Completed:
locateAdapterMainFileto detect.tsfiles in addition to.jsfiles@alcalzone/esbuild-registeras a dependency for running TypeScript files (same as js-controller)node -r @alcalzone/esbuild-registerwhen starting TypeScript adaptersImplementation Details:
1. locateAdapterMainFile() Enhancement (src/lib/adapterTools.ts)
.jsand.tsfiles in order:.jsis specified but not found, tries.tsequivalent<adapter-name>.js<adapter-name>.ts.jsover.tswhen both exist (backwards compatible)2. TestHarness.startAdapter() Update (src/tests/integration/lib/harness.ts)
node -r @alcalzone/esbuild-register <file> --consolefor.tsfiles (matching js-controller behavior)node <file> --consolefor.jsfiles (unchanged behavior)3. ControllerSetup.prepareTestDir() Update (src/tests/integration/lib/controllerSetup.ts)
@alcalzone/esbuild-register: '^2.5.1-1'to test directory dependencies4. Comprehensive Test Suite (src/lib/adapterTools.test.ts)
.tsfile references.jsto.tswhen only.tsexists.jswhen both exist5. Dependencies
@alcalzone/esbuild-register: ^2.5.1-1as a direct dependency (same version as js-controller)6. Changelog
Validation Results:
✅ Type Check: Passed
✅ Lint: Passed
✅ Build: Passed
✅ Tests: 8/8 passing
✅ CodeQL Security Scan: 0 alerts
✅ Manual Verification: TypeScript file detection working correctly
Backwards Compatibility:
Build Files:
build/directoryOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.