I have this set up before my mocha tests:
import chai from 'chai';
import chaiAlmost from 'chai-almost';
// some test values are approximately equal to spreadsheet values; see NOTE on materialsCost()
const TOLERANCE = 0.0501; // +/- cents
chai.use(chaiAlmost(TOLERANCE));
chai.should();
describe("quantity 1000, 4x1, black & blue, adh free=2", function () {...
And later I have an assertion:
it('displayPrice', done => {
instance.displayPrice(fakeContext)
props.should.have.property('displayPrice');
props.displayPrice.should.almost.equal(1953.19);
console.log({displayPrice: props.displayPrice})
done();
})
When running the test singly, the output is:
{ displayPrice: 1953.24 }
✓ displayPrice
43 passing (326ms)
However, when run the whole series of 8 test files, I see this:
2) quantity 1000, 4x1, black & blue, adh free=2
displayPrice:
AssertionError: expected 1953.24 to almost equal 1953.19
+ expected - actual
-1953.24
+1953.19
Not sure how that is possible.
I have this set up before my mocha tests:
And later I have an assertion:
When running the test singly, the output is:
However, when run the whole series of 8 test files, I see this:
2) quantity 1000, 4x1, black & blue, adh free=2
Not sure how that is possible.