Is it possible to monitor the behavior of an asynchronous function in a module that has been imported?
jest.mock('snowflake-promise');
import { Snowflake } from 'snowflake-promise';
describe('Snowflake', () => {
let snowflakeMocked: any;
beforeEach(async () => {
snowflakeMocked = Snowflake as jest.Mocked<typeof Snowflake>;
});
test('Investigating Snowflake...', async () => {
jest.spyOn(Snowflake, 'execute').mockResolvedValue(new Promise<void>());
An error occurs with the argument '"execute"' and cannot be assigned to parameter of type 'never'.
"snowflake-promise": "^4.2.0",