Add TypeScript integrations package

This commit is contained in:
2026-05-05 12:01:30 +00:00
commit e91176fb9b
5889 changed files with 53433 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import { createShellyDiscoveryDescriptor } from '../../ts/integrations/shelly/index.js';
tap.test('matches Shelly zeroconf records', async () => {
const descriptor = createShellyDiscoveryDescriptor();
const matcher = descriptor.getMatchers()[0];
const result = await matcher.matches({
name: 'shellyplus1pm-a8032abe54dc',
type: '_http._tcp.local.',
host: 'shellyplus1pm-a8032abe54dc.local',
port: 80,
txt: {
id: 'shellyplus1pm-a8032abe54dc',
model: 'SNSW-001P16EU',
},
}, {});
expect(result.matched).toBeTrue();
expect(result.normalizedDeviceId).toEqual('shellyplus1pm-a8032abe54dc');
});
export default tap.start();