diff --git a/lib/floor-guard.sh b/lib/floor-guard.sh index a573fe0..6a35df9 100755 --- a/lib/floor-guard.sh +++ b/lib/floor-guard.sh @@ -97,9 +97,15 @@ SUPPRESS_SUBSTRINGS = ( TS_EXPECT_ERROR = '@ts-expect-error' # floor-guard: allow pattern table SKIP_SUBSTRINGS = ( - '.skip(', '.only(', 'xit(', 'xdescribe(', 'fit(', 'fdescribe(', - 'it.todo(', '@pytest.mark.skip', '@unittest.skip', 't.Skip(', + '.skip(', '.only(', 'it.todo(', '@pytest.mark.skip', '@unittest.skip', + 't.Skip(', ) +# bare Jasmine/Jest focus-or-skip calls (xit/fit/xdescribe/fdescribe); the +# lookbehind keeps `exit(`, `SystemExit(`, `model.fit(` out (BLK-023). +SKIP_IDENT_RE = re.compile(r'(? {});" >> "$d/sample.test.js" out=$(cd "$d" && bash "$LIB" "$base" 2>&1); rc=$? check_kind SKIP "$rc" 2 "$out" 'FLOOR SKIP' +# ── SKIP_EXIT_CLEAN ─────────────────────────────────────────────────────── +d=$(mk_repo skipexit); base=$(git -C "$d" rev-parse HEAD) +{ + echo 'process.exit(1); // sys.exit(1)' # floor-guard: allow flip-test fixture + echo 'model.fit(x);' # floor-guard: allow flip-test fixture + echo 'const p = profit(1);' # floor-guard: allow flip-test fixture +} >> "$d/sample.test.js" +out=$(cd "$d" && bash "$LIB" "$base" 2>&1); rc=$? +check_kind SKIP_EXIT_CLEAN "$rc" 0 "$out" 'FLOOR GUARD: clean' + +# ── SKIP_XIT_FLAGS / SKIP_FIT_FLAGS / SKIP_FDESCRIBE_FLAGS ──────────────── +d=$(mk_repo skipxit); base=$(git -C "$d" rev-parse HEAD) +echo " xit('skipped', () => {});" >> "$d/sample.test.js" # floor-guard: allow flip-test fixture +out=$(cd "$d" && bash "$LIB" "$base" 2>&1); rc=$? +check_kind SKIP_XIT_FLAGS "$rc" 2 "$out" 'FLOOR SKIP' + +d=$(mk_repo skipfit); base=$(git -C "$d" rev-parse HEAD) +echo "fit('focused', () => {});" >> "$d/sample.test.js" # floor-guard: allow flip-test fixture +out=$(cd "$d" && bash "$LIB" "$base" 2>&1); rc=$? +check_kind SKIP_FIT_FLAGS "$rc" 2 "$out" 'FLOOR SKIP' + +d=$(mk_repo skipfdescribe); base=$(git -C "$d" rev-parse HEAD) +echo "fdescribe('focused', () => {});" >> "$d/sample.test.js" # floor-guard: allow flip-test fixture +out=$(cd "$d" && bash "$LIB" "$base" 2>&1); rc=$? +check_kind SKIP_FDESCRIBE_FLAGS "$rc" 2 "$out" 'FLOOR SKIP' + # ── DELETED_TEST ────────────────────────────────────────────────────────── d=$(mk_repo deleted); base=$(git -C "$d" rev-parse HEAD) rm "$d/sample.test.js"