Just create an instance of the object and check it directly. Since it sets them on this, they are essentially public values:
1 2 3 4 5 | it('works', () => { const obj = new SomeClass(1, 2); expect(obj.a).toBe(1); expect(obj.b).toBe(2); }); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.