Fix flaky getMinDurationFromAST test

Adds a bit of leeway so that the test won't fail due to tolerable
floating point inaccuracies.
pull/11425/head
Christopher Henn 2019-01-22 13:38:04 -08:00 committed by Chris Henn
parent 1abae7df0d
commit 8781ce8357
1 changed files with 3 additions and 1 deletions

View File

@ -1769,6 +1769,8 @@ export const AST_TESTS = [
describe('getMinDurationFromAST', () => {
test.each(AST_TESTS)('%s:\n\n```\n%s\n```', (__, ___, expected, ast) => {
expect(getMinDurationFromAST(ast)).toEqual(expected)
const actual = getMinDurationFromAST(ast)
expect(Math.abs(actual - expected)).toBeLessThan(5)
})
})