サンプル
jest 29.7.0: jest.spyOn on a getter property without 'get' accessType throws a base Error suggesting replaceProperty, which also throws a base Error, requiring explicit 'get' accessType
検証済みサンプル — npm jest 29.7.0: jest.spyOn on a getter property without 'get' accessType throws a base Error suggesting replaceProperty, which also throws a base…
sha256:202939633a31a75508047b1c53fc8aaa277b6c2c8bb004cfb47b5666d0ff6171
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 2
- ビルドした署名鍵
- 2
宣言された環境
node linux x64 node node npm
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-17 |
| node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-18 |
ケース
HOW- ゴール
- jest.spyOn on a getter property without 'get' accessType throws a base Error suggesting replaceProperty, which also throws a base Error, requiring explicit 'get' accessType
- パッケージ
- シンボル
-
- jest.spyOn
- jest.replaceProperty
- 環境
- node
- 作成日
- 2026-08-17T01:54:03Z
コントラクト
- jest.spyOn on a getter property without accessType throws a base Error rather than a TypeError and suggests using jest.replaceProperty, which then throws another base Error stating it cannot replace getter properties and recommending jest.spyOn(object, property, 'get').
- jest.spyOn(object, getterName) throws an Error instance where err instanceof TypeError is false
- jest.replaceProperty(object, getterName, value) throws an Error instance recommending accessType 'get'
- jest.spyOn(object, getterName, 'get') successfully creates a getter mock that permits mockReturnValue
ファイル
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs