sfdx-lwc-jest icon indicating copy to clipboard operation
sfdx-lwc-jest copied to clipboard

Add getRecords stub to uiRecordApi.js

Open p3v9d5ui opened this issue 3 years ago • 1 comments

Description

Steps to Reproduce

Execute sfdx-lwc-jest --coverage on an LWC app which uses the getRecords wire adaptor

Expected Results

The getRecords wire adaptor should be stubbed.

Actual Results

Test fails to run with the error TypeError: Invalid adapterId, it must be extensible., due to the inclusion of the getRecords wire adaptor.

Version

@salesforce/sfdx-lwc-jest: 1.1.1

Possible Solution

Add export const getRecords = createLdsTestWireAdapter(jest.fn()); to the uiRecordApi.js file

p3v9d5ui avatar Jul 27 '22 14:07 p3v9d5ui

@Templarian I don't see this adaptor in the uiRecordApi stub.

ekashida avatar Jul 27 '22 16:07 ekashida