Download mobile/modules/engine/src/utils/hardware/__tests__/hardware.test.ts from Anirudh1950/MentraOS: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/modules/engine/src/utils/hardware/__tests__/hardware.test.ts
- Command line
-
hf download hf://Anirudh1950/MentraOS/mobile/modules/engine/src/utils/hardware/__tests__/hardware.test.ts
-
curl -L -o hardware.test.ts https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/modules/engine/src/utils/hardware/__tests__/hardware.test.ts
1.27 kB
| import {describe, expect, test} from "bun:test" | |
| import {HardwareRequirementLevel, HardwareType} from "../../../types" | |
| import {vuzixZ100} from "../../../types/capabilities/vuzix-z100" | |
| import {HardwareCompatibility} from "../hardware" | |
| describe("HardwareCompatibility", () => { | |
| test("accepts a microphone requirement when glasses use the phone microphone fallback", () => { | |
| expect(vuzixZ100.hasMicrophone).toBe(false) | |
| const result = HardwareCompatibility.checkCompatibility( | |
| [{type: HardwareType.MICROPHONE, level: HardwareRequirementLevel.REQUIRED}], | |
| vuzixZ100, | |
| ) | |
| expect(result).toEqual({ | |
| isCompatible: true, | |
| missingRequired: [], | |
| missingOptional: [], | |
| warnings: [], | |
| }) | |
| }) | |
| test("continues to reject unavailable physical hardware", () => { | |
| const result = HardwareCompatibility.checkCompatibility( | |
| [ | |
| {type: HardwareType.MICROPHONE, level: HardwareRequirementLevel.REQUIRED}, | |
| {type: HardwareType.SPEAKER, level: HardwareRequirementLevel.REQUIRED}, | |
| ], | |
| vuzixZ100, | |
| ) | |
| expect(result.isCompatible).toBe(false) | |
| expect(result.missingRequired).toEqual([{type: HardwareType.SPEAKER, level: HardwareRequirementLevel.REQUIRED}]) | |
| }) | |
| }) | |