Package
Functions Testing Experimental
A local-first mocking package that suggests external function development is becoming a first-class workflow.
- Exposes `createMockClient` and helpers for mock objects and object sets.
- Supports `when(...)` and `whenQuery(...)` style stubbing.
- Query stubbing and helper exports landed quickly after the first beta.
- Some APIs are still explicitly unsupported, so it is not yet complete.
Relevant code
Most revealing source snippet
published: build/esm/mock/createMockClient.js
packages/functions-testing.experimental/src/mock/createMockClient.ts
open source file ->export function createMockClient() {
const stubs = [];
const queryStubs = [];
mockClient.whenQuery = (query, params) => ({
thenReturn: result => {
queryStubs.push({ queryApiName: query.apiName, params, value: result });
}
});
} Notes
Why it matters
This package matters because it changes the implied workflow.
Instead of assuming all interesting testing happens inside Foundry, it suggests Palantir expects developers to write and validate function logic locally.
That fits the broader discovery and SDK-generation story: ontology and function development are becoming more toolable outside the platform UI.
This package gained useful behavior quickly: object mocking, object-set mocking, then query stubbing and exported helpers. That is a substantive increase in local test ergonomics.