as-test 1.0.9 → 1.0.11

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/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2026-04-18 - v1.0.11
6
+
7
+ ### Coverage
8
+
9
+ - fix: ignore additional AssemblyScript compile-time builtin calls during coverage instrumentation, including `isVector`, `isVoid`, and `lengthof`.
10
+
11
+ ## 2026-04-18 - v1.0.10
12
+
13
+ ### Reporting
14
+
15
+ - feat: when coverage is incomplete and `--show-coverage` is not passed, the default reporter now prints `Coverage (run with --show-coverage to display uncovered points)`; otherwise it keeps the plain `Coverage` header.
16
+
17
+ ### Assertions
18
+
19
+ - fix: register top-level `expect(...)` and `log(...)` calls (outside explicit suites) into a synthetic global suite so they are counted and reported in final totals.
20
+
21
+ ## 2026-04-18 - v1.0.9
22
+
23
+ ### Runtime
24
+
25
+ - fix: align default runtime command selection with `buildOptions.target` so `bindings` runs no longer probe `default.wasi.js` first or emit unnecessary fallback warnings.
26
+
27
+ ### Fuzzing
28
+
29
+ - feat: allow per-fuzzer operation overrides via `.generate(generator, operations)` and `.generateTyped(generator, operations)` in addition to the existing third `fuzz(..., operations)` argument.
30
+
31
+ ### Type Ergonomics
32
+
33
+ - feat: add and publish an IDE-only declaration shim (`assembly/as-test.intellisense.d.ts`) so `FuzzSeed` option objects can omit fields like `exclude` without TypeScript IntelliSense errors.
34
+
35
+ ### Examples
36
+
37
+ - chore: remove `examples/08-json-as-runner-compare` and update `examples/package.json` test scripts accordingly.
38
+
5
39
  ## 2026-03-31 - v1.0.7
6
40
 
7
41
  ### Coverage
package/assembly/index.ts CHANGED
@@ -41,6 +41,7 @@ export { __as_test_json_value } from "./util/json";
41
41
 
42
42
  let entrySuites: Suite[] = [];
43
43
  let entryFuzzers: FuzzerBase[] = [];
44
+ let globalExpectationSuite: Suite | null = null;
44
45
 
45
46
  // @ts-ignore
46
47
  const FILE = isDefined(ENTRY_FILE) ? ENTRY_FILE : "unknown";
@@ -210,10 +211,7 @@ export function expect<T>(
210
211
  location: string = "",
211
212
  ): Expectation<T> {
212
213
  const test = new Expectation<T>(value, message, snapshotKey(), location);
213
-
214
- if (current_suite) {
215
- current_suite!.addExpectation(test);
216
- }
214
+ resolveExpectationSuite().addExpectation(test);
217
215
 
218
216
  return test;
219
217
  }
@@ -257,11 +255,10 @@ export function __as_test_log_is_enabled(): bool {
257
255
  export function __as_test_log_serialized(formatted: string): void {
258
256
  if (!formatted) return;
259
257
  const lines = formatted.split("\n");
258
+ const suite = resolveExpectationSuite();
260
259
  for (let i = 0; i < lines.length; i++) {
261
260
  const line = unchecked(lines[i]);
262
- if (current_suite) {
263
- current_suite!.addLog(new Log(line));
264
- }
261
+ suite.addLog(new Log(line));
265
262
  }
266
263
  }
267
264
 
@@ -509,6 +506,20 @@ function registerSuite(
509
506
  suites.push(suite);
510
507
  }
511
508
 
509
+ function resolveExpectationSuite(): Suite {
510
+ if (current_suite) return current_suite!;
511
+ return ensureGlobalExpectationSuite();
512
+ }
513
+
514
+ function ensureGlobalExpectationSuite(): Suite {
515
+ if (globalExpectationSuite) return globalExpectationSuite!;
516
+ const suite = new Suite("global", (): void => {}, "describe");
517
+ suite.file = FILE;
518
+ globalExpectationSuite = suite;
519
+ entrySuites.push(suite);
520
+ return suite;
521
+ }
522
+
512
523
  class CoverageReport {
513
524
  total: i32 = 0;
514
525
  covered: i32 = 0;
@@ -283,7 +283,7 @@ class DefaultReporter {
283
283
  renderSnapshotSummary(event.snapshotSummary, true);
284
284
  }
285
285
  if (event.coverageSummary.enabled) {
286
- renderCoverageSummary(event.coverageSummary);
286
+ renderCoverageSummary(event.coverageSummary, event.showCoverage);
287
287
  if (event.showCoverage && event.coverageSummary.uncovered) {
288
288
  renderCoveragePoints(event.coverageSummary.files);
289
289
  }
@@ -633,9 +633,13 @@ function renderSummaryLine(label, summary, layout = {
633
633
  process.stdout.write(", ");
634
634
  process.stdout.write(totalText.padStart(layout.totalWidth) + "\n");
635
635
  }
636
- function renderCoverageSummary(summary) {
636
+ function renderCoverageSummary(summary, showCoverage) {
637
637
  console.log("");
638
- console.log(chalk.bold("Coverage"));
638
+ const shouldShowCoverageHint = !showCoverage && summary.total > 0 && summary.uncovered > 0;
639
+ const coverageHeading = shouldShowCoverageHint
640
+ ? "Coverage (run with --show-coverage to display uncovered points)"
641
+ : "Coverage";
642
+ console.log(chalk.bold(coverageHeading));
639
643
  if (!summary.files.length || summary.total <= 0) {
640
644
  console.log(` ${chalk.dim("No eligible source files were tracked for coverage.")}`);
641
645
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "as-test",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "author": "Jairus Tanaka",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,7 +34,10 @@ const COVERAGE_IGNORED_BUILTINS = new Set([
34
34
  "isReference",
35
35
  "isSigned",
36
36
  "isString",
37
+ "isVector",
38
+ "isVoid",
37
39
  "isUnsigned",
40
+ "lengthof",
38
41
  "load",
39
42
  "nameof",
40
43
  "offsetof",