LoginSignup
0
0

More than 3 years have passed since last update.

jasmineでメソッドとプロパティを持つspy objectの作り方

Last updated at Posted at 2020-02-26

Jasmin3.3

メソッドを定義したオブジェクトにプロパティを手動で追加するだけ
定義してないプロパティに対して、spyOnPropertで追加すると怒られる、、。

test.spec.ts
let spy = jasmine.createSpyObj('Spy', ['testFunc', 'testFunc2']);
spy.testProperty = '4';

参考(spy関連)

jasmineで例外をテストする
[JavaScript] jasmine spy(いわゆるテストダブルあるいはモック) レシピ集

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0