# Testing JSON schemas

### Validate TS schema <-> real objects
Run `npm run compile`

### To access schema coverage run
Run `npm run test:new:coverage` and look for validate-cjs.js coverage


### Q/A Section

**Q:** Why enumerate detects not _only_ Nordic's devices;
**A:** it is expected behavior (if related traits are found like serialport)


### DOCUMENTATION on the traits' logic:
1. If no filter is set user  will get all the properties (todo: check if confirmed by sys team)
2. All traits (except exceptions) will be set to false, except those that are set in filter to true
3. Exceptions (even if not in the filter):
   - usb - always set to true if connected by usb
   - serialports - will be true if they are present
   - seggerUsb - will be set if jlink: true or seggerUsb: true or both are true

Note: broken - will be detected only if present in filter (!!) -> check how apps detect broken devices?
Note 2: requested behavior: get Device.broken AND device.traits.broken real values with no relying on set filters ---- FINISH device1

// todo: Add reasons why tests are skipped