HSLG Media

native-mobile-wiring.test.cjs

native-mobile-wiring.test.cjs

Source file: tests/contracts/native-mobile-wiring.test.cjs

Module: tests-contracts

Size: 101 lines

SHA-256: 6b072593d90d9840e6f7251bcd742e3a1bf7350c014961f33df2685ec5a6652b

Responsibility

Checks service and UI contract invariants.

Declared entry points

  • assert — source line 3.
  • path — source line 4.
  • fs — source line 6.
  • root — source line 7.
  • load — source line 8.
  • replies — source line 9.
  • makeServer — source line 19.
  • calls — source line 20.
  • fetchImpl — source line 21.
  • target — source line 22.
  • client — source line 31.
  • result — source line 32.
  • client — source line 39.
  • client — source line 47.
  • token — source line 52.
  • vault — source line 53.
  • client — source line 54.
  • source — source line 69.
  • manifest — source line 75.
  • adapter — source line 77.
  • boot — source line 86.
  • adapter — source line 87.
  • native — source line 88.
  • shared — source line 89.

Imports and dependencies

  • Line 2: const {test}=require('node:test');
  • Line 3: const assert=require('node:assert/strict');
  • Line 4: const path=require('node:path');
  • Line 5: const {pathToFileURL}=require('node:url');
  • Line 6: const fs=require('node:fs');

Behaviour and audit locations

  • Line 76: assert.equal(manifest.dependencies['@capacitor/barcode-scanner'],'3.1.3');
  • Line 77: const adapter=fs.readFileSync(path.join(root,'apps/mobile/native-adapters/CapacitorDeviceServices.ts'),'utf8');
  • Line 78: assert.match(adapter,/CapacitorBarcodeScannerTypeHint\.QR_CODE/);
  • Line 79: // Exact runtime export verified from the supplied @capacitor/barcode-scanner 3.1.3 distribution.
  • Line 80: assert.match(adapter,/import\s*\{\s*CapacitorBarcodeScanner\s*,/);
  • Line 85: test('Capacitor boot and native device test panel are explicit and fail closed',()=>{
  • Line 86: const boot=fs.readFileSync(path.join(root,'apps/mobile/src/CapacitorBoot.ts'),'utf8');
  • Line 87: const adapter=fs.readFileSync(path.join(root,'apps/mobile/native-adapters/CapacitorDeviceServices.ts'),'utf8');

Relationship to the system

This page is the file-level source reference, not the architecture rationale. Read the module explanation, the corresponding architecture decision and user guide before changing behaviour. Names and line locations above are extracted from this exact source version; they are reference points, not proof that an external service or a phone feature works.

Change verification

Review the entry points and errors in this file, then run the module’s associated tests, source dependency gate, history gate and documentation coverage check. If the file changes an API response, user interaction, data model, deployment or third-party dependency, revise those human explanations and disaster recovery/licensing when relevant. Do not infer actual native or external API operation from source presence.