From 82896082bc1445a02ccfca8ce8ff899bbc7ef3c9 Mon Sep 17 00:00:00 2001 From: Adam Fisher Date: Tue, 4 Aug 2026 14:20:10 +0000 Subject: [PATCH] Fix failing test and non-terminating test runner pairingTest() returned false while the test expected true. It now returns true. `jest --watchAll` in package.json and --watch in script/test meant ./script/test never exited. package.json now runs plain jest and script/test takes an explicit --watch flag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- javascript-esm/package.json | 2 +- javascript-esm/script/test | 10 ++++++++-- javascript-esm/src/index.js | 2 +- javascript-esm/src/index.test.js | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/javascript-esm/package.json b/javascript-esm/package.json index 43e3e6e..6a326cb 100644 --- a/javascript-esm/package.json +++ b/javascript-esm/package.json @@ -8,7 +8,7 @@ "jest": "^29.6.0" }, "scripts": { - "test": "jest --watchAll", + "test": "jest", "start": "node src/index.js" }, "jest": { diff --git a/javascript-esm/script/test b/javascript-esm/script/test index ee53164..8e0454e 100755 --- a/javascript-esm/script/test +++ b/javascript-esm/script/test @@ -1,5 +1,11 @@ #!/usr/bin/env bash -set -e +set -euo pipefail -yarn test --watch +cd "$(dirname "${BASH_SOURCE[0]}")/.." + +if [[ "${1:-}" == "--watch" ]]; then + yarn test --watchAll +else + yarn test +fi diff --git a/javascript-esm/src/index.js b/javascript-esm/src/index.js index 0f2f55b..b9ad5ad 100644 --- a/javascript-esm/src/index.js +++ b/javascript-esm/src/index.js @@ -1,3 +1,3 @@ export const pairingTest = () => { - return false; + return true; } \ No newline at end of file diff --git a/javascript-esm/src/index.test.js b/javascript-esm/src/index.test.js index 45c3aee..97dd210 100644 --- a/javascript-esm/src/index.test.js +++ b/javascript-esm/src/index.test.js @@ -1,5 +1,5 @@ import { pairingTest } from './index' -test('a failing test', () => { +test('pairingTest returns true', () => { expect(pairingTest()).toBe(true); }); \ No newline at end of file