Adds a check that the regex on /proc/cpuinfo actually matches correctly, and rejects the promise if not. I've added a small unit test that passes "A Bad Revision" to getCpuInfo and verifies catch is indeed called on the promise. Not sure if this is how you'd want to test this, but, it does verify the error is correctly caught by the Promise returned.
This really only happened when running on something not a Pi, but, was a bit inconvenient when wanting to test local changes on my laptop as it crashes the whole program vs the Promise handling it as I expected.
Adds a check that the regex on
/proc/cpuinfo
actually matches correctly, and rejects the promise if not. I've added a small unit test that passes "A Bad Revision" togetCpuInfo
and verifiescatch
is indeed called on the promise. Not sure if this is how you'd want to test this, but, it does verify the error is correctly caught by the Promise returned.This really only happened when running on something not a Pi, but, was a bit inconvenient when wanting to test local changes on my laptop as it crashes the whole program vs the Promise handling it as I expected.
Fixes #91