diff --git a/Makefile b/Makefile index 19b5faa..5908299 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ WEB_DIST := replay-ui/dist GOLINES := $(shell $(GO) env GOPATH)/bin/golines -.PHONY: bootstrap proto sidecar sanderling install test test-go test-browser test-companion test-kotlin test-spec-api web-test web-typecheck web-build web-dev replay-dev docs clean release-cli release-npm-dry fmt fmt-go fmt-kotlin fmt-ts fmt-swift +.PHONY: bootstrap proto sidecar sanderling install test test-go test-browser test-companion test-kotlin test-spec-api spec-typecheck web-test web-typecheck web-build web-dev replay-dev docs clean release-cli release-npm-dry fmt fmt-go fmt-kotlin fmt-ts fmt-swift bootstrap: $(GO) mod download @@ -101,7 +101,7 @@ fmt-ts: fmt-swift: xcrun swift-format format -i -r companion/Sources -test: test-go test-spec-api web-typecheck web-test +test: test-go spec-typecheck test-spec-api web-typecheck web-test test-go: $(GO) test $(GO_PACKAGES) @@ -126,6 +126,9 @@ test-kotlin: test-spec-api: cd pkg/spec && npm test --silent +spec-typecheck: + cd pkg/spec && npm run check --silent + docs: $(DOCS_OUT) build/site/_assets @echo "built $(words $(DOCS_OUT)) pages to build/site" diff --git a/pkg/spec/test/api.test.ts b/pkg/spec/test/api.test.ts index fde96a3..eb38207 100644 --- a/pkg/spec/test/api.test.ts +++ b/pkg/spec/test/api.test.ts @@ -112,7 +112,12 @@ function installFakeRuntime(): RecordedRuntime { extract: (getter: (state: State) => T, name?: string): Extracted => { calls.extracts.push(getter as (state: State) => unknown); calls.extractNames.push(name); - return { current: undefined as unknown as T, previous: undefined }; + const handle: Extracted = { + current: undefined as unknown as T, + previous: undefined, + named: () => handle, + }; + return handle; }, always: (predicateOrFormula: (() => boolean) | Formula): Formula => { calls.alwaysArgs.push(predicateOrFormula);