@ark/attest 0.45.9 → 0.45.10

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.
@@ -119,8 +119,14 @@ const getBaselineSourceFile = (originalFile) => {
119
119
  const functionNames = getConfig().testDeclarationAliases;
120
120
  const calls = getCallExpressionsByName(originalFile, functionNames);
121
121
  let baselineSourceFileText = originalFile.getFullText();
122
- calls.forEach(call => {
123
- baselineSourceFileText = baselineSourceFileText.replace(call.getFullText(), "");
124
- });
122
+ // for each test function like `it` or `bench`, walk up the AST to find the complete expression
123
+ for (const call of calls) {
124
+ let currentNode = call;
125
+ // ensure we capture the entire chain like bench(...).types(...)
126
+ while (currentNode.parent && !ts.isExpressionStatement(currentNode))
127
+ currentNode = currentNode.parent;
128
+ const fullExpressionText = currentNode.getFullText();
129
+ baselineSourceFileText = baselineSourceFileText.replace(fullExpressionText, "");
130
+ }
125
131
  return baselineSourceFileText;
126
132
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ark/attest",
3
- "version": "0.45.9",
3
+ "version": "0.45.10",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "David Blass",
@@ -36,9 +36,9 @@
36
36
  "@typescript/analyze-trace": "0.10.1",
37
37
  "@typescript/vfs": "1.6.1",
38
38
  "prettier": "3.5.3",
39
- "@ark/util": "0.45.9",
40
- "arktype": "2.1.19",
41
- "@ark/fs": "0.45.9"
39
+ "@ark/fs": "0.45.10",
40
+ "@ark/util": "0.45.10",
41
+ "arktype": "2.1.19"
42
42
  },
43
43
  "devDependencies": {
44
44
  "typescript": "5.8.2"