Skip to content

The Sociable API fails to function when class constructor is left empty of params #509

@kostyazgara

Description

@kostyazgara

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

The new Sociable API is not working properly. I tried to setup a minimal reproducible example in my repo.

const { unit, unitRef } = await TestBed.sociable(TestService).expose(TestSociableService).compile();
const testDependService = unitRef.get(TestDependService);

unit.test();
expect(testDependService.call).toHaveBeenCalledWith(true); // returns undefined, but should true

Minimum reproduction code

https://github.com/KostyaZgara/suites-expose-reproduce

Steps to reproduce

  • Clone repo
  • run npm i
  • run npm run test-ts or npm run test-swc

Expected behavior

return method should not be mocked when exposing the class TestSociableService using .expose() API in sociable test. I'm expecting to have success assert check expect(testDependService.call).toHaveBeenCalledWith(true)

Suites version

"@suites/di.nestjs": "3.0.0", "@suites/doubles.jest": "3.0.0", "@suites/unit": "3.0.0",

Node.js version

20.11.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions