Skip to content

Conversation

@HerrCai0907
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 28, 2026 03:38
@HerrCai0907 HerrCai0907 linked an issue Jan 28, 2026 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates a lightweight AssemblyScript-based unit test framework into the warpo_extension tree and wires it into the existing assemblyscript-unittest-framework setup. It adds core assertion/mocking utilities, environment bindings, and a comprehensive test suite exercising equality, formatting, and mocking behavior for the Warpo extensions.

Changes:

  • Introduces a warpo/std/warpo/test runtime helper library (expectations, comparison helpers, formatting, mocking, and env bindings) that delegates to the external unittest framework environment.
  • Adds Warpo-specific AssemblyScript tests under tests/warpo_extension to validate the new equality helpers, formatting logic, and function mocking behavior (including call_indirect and default params).
  • Updates as-test.config.js and test TypeScript configuration to include the new Warpo extension test sources in the test runner.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
warpo_extension/std/warpo/test/mockInstrument.ts Declares externs for mock function control and wraps them in a MockFn helper used by the mocking API.
warpo_extension/std/warpo/test/index.ts Exposes the public testing API (describe, test, lifecycle hooks, mock/unmock/remock, and expect) backed by the internal implementations.
warpo_extension/std/warpo/test/index.d.ts Adds an (currently empty) declaration stub alongside the new test module, presumably for future type surface alignment.
warpo_extension/std/warpo/test/implement.ts Implements core test orchestration and mocking behavior, wiring test and hook functions into the external env and managing mock registration and ignore flags.
warpo_extension/std/warpo/test/formatPrint.ts Implements toJson pretty-printing for a variety of primitive, array/typed-array, ArrayBuffer, Set, Map, and generic object values for assertion messages.
warpo_extension/std/warpo/test/expect.ts Implements the Value<T> expectation API (relational operators, null checks, equality, approximate equality, and type identity checks) and forwards results to the external assertion collector.
warpo_extension/std/warpo/test/env.ts Binds to the __unittest_framework_env imports for description management, test registration, lifecycle hooks, and result collection.
warpo_extension/std/warpo/test/comparison.ts Provides deep equality helpers for nullable references, ArrayBuffer, array-like containers, Map, and Set, plus a generic equal<T> predicate used by expect.
tests/warpo_extension/warpo/test/mockBaseFunc.ts Defines simple functions and a class used as fixtures in the mocking tests (direct calls, call_indirect patterns, default parameters, and method callbacks).
tests/warpo_extension/warpo/test/mock.test.ts Adds tests covering the mocking API, including call counts, unmock/remock behavior, call_indirect usage, class method mocking, and functions with default parameters.
tests/warpo_extension/warpo/test/format.test.ts Adds tests validating toJson behavior for arrays, ArrayBuffer, Set, Map, nullable values, booleans, strings (including control codes and unicode), and user-defined classes.
tests/warpo_extension/warpo/test/expect.test.ts Adds tests for the expectation API, covering numeric comparisons, null/notNull, .not inversion, inheritance-aware isa, and isExactly for nullable and non-nullable references.
tests/warpo_extension/warpo/test/comparison.test.ts Adds extensive tests for the deep equality helpers across base types, arrays and typed arrays, maps, sets, nullable collections, and nested multi-level container structures.
tests/warpo_extension/tsconfig.json Configures TypeScript compilation for the new Warpo extension tests by extending the shared Warpo TS config.
as-test.config.js Extends the unittest framework configuration to include Warpo extension sources and tests, and to use a recursive glob for AssemblyScript source files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

merge ut framework ./assembly part

2 participants