1.0.0 • Published 3 years ago
lwc-wire-service-sfdc-mocks v1.0.0
Lightning Data Service and UI API Mocks for Wire Service
This is a mock implementation of Lightning Data Service wire adapters. By providing mock adapters, metadata and data, "off core" development becomes possible. You can develop Lightning web components that use @wire
for any LDS data source without access to a Salesforce server or core code.
Refer to the LWC developer guide for documentation on the wire service.
Supported data types
- @wire(getRecord, { ... })
- @wire(getObjectInfo, { ... })
- @wire(getPicklistValues, { ... })
- @wire(getPicklistValuesByRecordType, { ... })
- @wire(getRecordUi, { ... })
- @wire(getRecordCreateDefaults, { ... })
See the Salesforce Data and Metadata for documentation on these data types.
The following types are supported but their adapter id and meta/data shape is not finalized.
- @wire(getGlobalActions, { ... })
- @wire(getRecordActions, { ... })
- @wire(getRecordEditActions, { ... })
- @wire(getRelatedListActions, { ... })
- @wire(getRelatedListRecordActions, { ... })
- @wire(getListViewHeaderActions, { ... })
- @wire(getListViewRecordActions, { ... })
- @wire(getListViewChartActions, { ... })
- @wire(getLightningPageActions, { ... })
- @wire(getLookupActions, { ... })
- @wire(getMruListActions, { ... })
- @wire(getPhotoActions, { ... })
- @wire(getLookupRecords, { ... })
Installation
1) Add dependency on this module
yarn add -D lwc-wire-service-sfdc-mocks
2) Register the mocks
Register the mocks before creating the root LWC component. For example:
import * as lwc from 'lwc';
import App from 'x-my-app';
// ADD THIS
import { registerMockedWireService } from 'lwc-wire-service-sfdc-mocks';
registerMockedWireService(lwc);
const container = document.getElementById('main');
const element = lwc.createElement('x-my-app', { is: App });
container.appendChild(element);
1.0.0
3 years ago
10.0.0-alpha4
3 years ago
4.0.1-alpha4
3 years ago
5.1.3-alpha4
3 years ago
4.0.0-alpha4
3 years ago
5.1.2-alpha4
3 years ago
5.1.1-alpha4
3 years ago
5.1.0-alpha4
3 years ago
5.0.0-alpha4
3 years ago
1.0.2
3 years ago