Browse Source

Clock test allows slight variance for amount of real time passage.

master
Bryan Miller 5 years ago
parent
commit
d137381005
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      test/unit.src.common.clock.spec.js

+ 4
- 2
test/unit.src.common.clock.spec.js View File

let dt = speedTest(ts); let dt = speedTest(ts);
expect(count).to.be.gt(ts - d); expect(count).to.be.gt(ts - d);
expect(count).to.be.lt(ts + d); expect(count).to.be.lt(ts + d);
expect(dt).to.be.lt(1000);
expect(dt).to.be.gt(990);
expect(dt).to.be.lt(1010);
}); });


it("4Mhz for approx. 1 second", function(){ it("4Mhz for approx. 1 second", function(){
let dt = speedTest(ts); let dt = speedTest(ts);
expect(count).to.be.gt(ts - d); expect(count).to.be.gt(ts - d);
expect(count).to.be.lt(ts + d); expect(count).to.be.lt(ts + d);
expect(dt).to.be.lt(1000);
expect(dt).to.be.gt(990);
expect(dt).to.be.lt(1010);
}); });
}); });

Loading…
Cancel
Save