From acfcc01d59aea31efacf21dbae2f92d1c29255a4 Mon Sep 17 00:00:00 2001 From: Andy Stoneberg Date: Thu, 5 Dec 2024 16:10:36 -0500 Subject: [PATCH] add flaky test --- javascript/function.js | 6 +++++- javascript/function.spec.js | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/javascript/function.js b/javascript/function.js index 3f3ebe345..2a4a74eb8 100644 --- a/javascript/function.js +++ b/javascript/function.js @@ -4,8 +4,12 @@ function someFunc(arg1, arg2) { return _.has(arg1, arg2); } +function flaky(arg1, arg2) { + return Math.random() < 0.5 +} + function dummyFunc() { return true } -export { dummyFunc, someFunc }; +export { dummyFunc, someFunc, flaky }; diff --git a/javascript/function.spec.js b/javascript/function.spec.js index e7ce75f84..3fd06165b 100644 --- a/javascript/function.spec.js +++ b/javascript/function.spec.js @@ -1,6 +1,11 @@ -import { dummyFunc } from "./function"; +import { dummyFunc, flaky } from "./function"; test('baseline', () => { expect(dummyFunc()).toBe(true); } +); + +test('flaky', () => { + expect(flaky()).toBe(true); + } ); \ No newline at end of file