tamperward 2.29.6 → 2.29.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +5 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -9914,7 +9914,7 @@ function namesProtectedSnapshot(seg, policy) {
|
|
|
9914
9914
|
}
|
|
9915
9915
|
return null;
|
|
9916
9916
|
}
|
|
9917
|
-
var RULE12, RUNNER3, PM_TEST_SCRIPT, UPDATE_ANY, UPDATE_WITH_RUNNER, INSTA_ACCEPT, UPDATE_EXPECT, REGEN_SCRIPT, MUTATE, snapshotRewrite;
|
|
9917
|
+
var RULE12, RUNNER3, PM_TEST_SCRIPT, UPDATE_ANY, UPDATE_WITH_RUNNER, INSTA_ACCEPT, UPDATE_EXPECT, TAP_SNAPSHOT, REGEN_SCRIPT, MUTATE, snapshotRewrite;
|
|
9918
9918
|
var init_snapshot_rewrite = __esm({
|
|
9919
9919
|
"src/detectors/snapshot-rewrite.ts"() {
|
|
9920
9920
|
"use strict";
|
|
@@ -9922,12 +9922,13 @@ var init_snapshot_rewrite = __esm({
|
|
|
9922
9922
|
init_finding();
|
|
9923
9923
|
init_command();
|
|
9924
9924
|
RULE12 = "snapshot-rewrite";
|
|
9925
|
-
RUNNER3 = /\b(?:jest|vitest|playwright|ava)\b/;
|
|
9925
|
+
RUNNER3 = /\b(?:jest|vitest|playwright|ava|tap)\b/;
|
|
9926
9926
|
PM_TEST_SCRIPT = /(?:^|\s)(?:npm|pnpm|yarn|bun)\s+(?:t|tst|test|run(?:-script)?\s+\S*test\S*)(?:\s|$)/;
|
|
9927
9927
|
UPDATE_ANY = /--(?:update-?[sS]napshots?|test-update-snapshots|snapshot-update)\b/;
|
|
9928
|
-
UPDATE_WITH_RUNNER = /(?:^|\s)(?:-u|--update)(?:\s|$)/;
|
|
9928
|
+
UPDATE_WITH_RUNNER = /(?:^|\s)(?:-u|--update|--snapshot)(?:=(?:1|true))?(?:\s|$)/;
|
|
9929
9929
|
INSTA_ACCEPT = /\bcargo\s+insta\s+(?:accept\b|.*\s--accept\b)/;
|
|
9930
9930
|
UPDATE_EXPECT = /(?:^|\s)UPDATE_EXPECT=\S+/;
|
|
9931
|
+
TAP_SNAPSHOT = /(?:^|\s)TAP_SNAPSHOT=1(?:\s|$)/;
|
|
9931
9932
|
REGEN_SCRIPT = /\b(?:update|regen(?:erate)?|re?bless)[-_.]?(?:golden|snapshots?|baselines?|expected)\b/i;
|
|
9932
9933
|
MUTATE = /(?:^|\s)(?:rm|cp|mv|tee|truncate|dd)(?:\s|$)|sed\s+-i|>{1,2}|\bfind\b.*\s-(?:delete\b|exec\s+rm\b)|\bgit\s+(?:checkout|restore)\b/;
|
|
9933
9934
|
snapshotRewrite = {
|
|
@@ -9945,6 +9946,7 @@ var init_snapshot_rewrite = __esm({
|
|
|
9945
9946
|
else if ((RUNNER3.test(seg) || PM_TEST_SCRIPT.test(seg)) && UPDATE_WITH_RUNNER.test(seg)) why = "running the test runner in update mode rewrites failing snapshots to match current output";
|
|
9946
9947
|
else if (INSTA_ACCEPT.test(seg)) why = "cargo insta accept rewrites every pending snapshot to match current output";
|
|
9947
9948
|
else if (UPDATE_EXPECT.test(seg)) why = "UPDATE_EXPECT=1 rewrites every expect-test expectation to match current output";
|
|
9949
|
+
else if (TAP_SNAPSHOT.test(seg)) why = "TAP_SNAPSHOT=1 rewrites every node-tap snapshot to match current output";
|
|
9948
9950
|
else if (REGEN_SCRIPT.test(seg)) why = "a regeneration script rewrites the recorded expected output from current output";
|
|
9949
9951
|
else {
|
|
9950
9952
|
const path = MUTATE.test(seg) ? namesProtectedSnapshot(seg, policy) : null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamperward",
|
|
3
|
-
"version": "2.29.
|
|
3
|
+
"version": "2.29.7",
|
|
4
4
|
"description": "The deterministic agent-integrity gate. One ruleset, evaluated on the actual diff/commands as a verdict, enforced everywhere a change can be made.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "hexrift",
|