salesforce / sfdx-lwc-jest

Run Jest against LWC components in SFDX workspace environment
MIT License
165 stars 82 forks source link

Add getRecords stub to uiRecordApi.js #282

Closed p3v9d5ui closed 5 months ago

p3v9d5ui commented 2 years ago

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

ekashida commented 2 years ago

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

pozil commented 5 months ago

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