salesforce/sfdx-lwc-jest

Add getRecords stub to uiRecordApi.js

p3v9d5ui opened this issue · 2 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

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

@ekashida I guess that you can close this issue now :)