All Projects β†’ camelCaseDave β†’ xrm-mock

camelCaseDave / xrm-mock

Licence: MIT license
πŸ“š A fake implementation of the Xrm object model. Written in TypeScript against @types/xrm definitions.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to xrm-mock

xrm-mock-generator
πŸ“– Β Generates a mock Xrm.Page object. Commonly used by xrm-mock to test Dynamics 365 client-side customisations.
Stars: ✭ 15 (-76.56%)
Mutual labels:  mock, dynamics-crm, dynamics-365, xrm, unit-test, microsoft-dynamics-365
powerapps-specflow-bindings
A SpecFlow bindings library for model-driven Power Apps.
Stars: ✭ 19 (-70.31%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
Xrm-Quick-Edit
A Dynamics CRM Add-In for speeding up tasks such as translating or toggling field security on or off
Stars: ✭ 13 (-79.69%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
generator-nullfactory-xrm
Yeoman generator for Dynamics 365 Solutions. It generates a project structure that facilitates the quick creation builds and automated release strategies with minimal effort.
Stars: ✭ 15 (-76.56%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
DynamicsNode
Create simple scripts to interact with Dynamics CRM using Node.js
Stars: ✭ 27 (-57.81%)
Mutual labels:  dynamics-crm, dynamics-365, xrm
Daxif
A framework for automating a lot of xRM development processses. By using simple F# script commands/files one can save a lot of time and effort during this process by using Delegates DAXIF# library.
Stars: ✭ 37 (-42.19%)
Mutual labels:  dynamics-crm, dynamics-365
mockingbird
🐦 Decorator Powered TypeScript Library for Creating Mocks
Stars: ✭ 70 (+9.38%)
Mutual labels:  mock, unit-test
better-mock
Forked from Mockjs, Generate random data & Intercept ajax request. Support miniprogram.
Stars: ✭ 140 (+118.75%)
Mutual labels:  mock, fake
moq.ts
Moq for Typescript
Stars: ✭ 107 (+67.19%)
Mutual labels:  mock, fake
cds-for-code
VSCode extension for working with Microsoft Common Data Service (CDS)
Stars: ✭ 22 (-65.62%)
Mutual labels:  dynamics-crm, dynamics-365
integration-dynamics
The easiest way to connect Dynamics 365 with WordPress.
Stars: ✭ 17 (-73.44%)
Mutual labels:  dynamics-crm, dynamics-365
Dynamics365BulkSolutionExporter
[Work In Progress] Take backup of whole D365 organization or export multiple solutions.
Stars: ✭ 30 (-53.12%)
Mutual labels:  dynamics-crm, dynamics-365
kmpapp
πŸ‘¨β€πŸ’» Kotlin Mobile Multiplatform App (Android & iOS). One Code To Rule Them All. MVVM, DI (Kodein), coroutines, livedata, ktor, serialization, mockk, detekt, ktlint, jacoco
Stars: ✭ 34 (-46.87%)
Mutual labels:  mock, unit-test
ts-mock-imports
Intuitive mocking library for Typescript class imports
Stars: ✭ 103 (+60.94%)
Mutual labels:  mock, fake
jest-ts-auto-mock
Jest test utility with automatic mock creation for interfaces and classes
Stars: ✭ 150 (+134.38%)
Mutual labels:  mock, fake
Advanced-MultiSelect-for-Dynamics
Advanced MultiSelect for Dynamics 365 / Dynamics CRM is a multi-select / multi-checkbox control on a form. It represents a set of related data items (based on N:N relations + FetchXml) and gives a user an ability to associate/disassociate records of related entities in a quick and convenient way.
Stars: ✭ 14 (-78.12%)
Mutual labels:  dynamics-crm, dynamics-365
Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+295.31%)
Mutual labels:  mock, fake
fakey-json
This is a utility for mocking json data that pretends the api response data with JSON format.
Stars: ✭ 27 (-57.81%)
Mutual labels:  mock, fake
Ts Auto Mock
Typescript transformer to unlock automatic mock creation for interfaces and classes
Stars: ✭ 204 (+218.75%)
Mutual labels:  mock, fake
Fake Xrm Easy
The testing framework for Dynamics CRM and Dynamics 365 which runs on an In-Memory context and deals with mocks or fakes for you
Stars: ✭ 216 (+237.5%)
Mutual labels:  mock, fake

Build Status npm version Downloads Test Coverage

πŸ“š xrm-mock

Join the chat at https://gitter.im/xrm-mock/Lobby

xrm-mock is a fake implementation of the Dynamics 365 Client API and Xrm object model. Written in TypeScript against @types/xrm definitions.

xrm-mock-generator is an opinionated toolset for building fake Xrm objects.

Installing

For the latest stable version

npm install xrm-mock -D

Usage

Import XrmMockGenerator in your unit test file

import { XrmMockGenerator } from "xrm-mock";

Initialise a global Xrm object

XrmMockGenerator.initialise();

Customise your form by adding attributes

XrmMockGenerator.Attribute.createBool("new_havingfun", true);

Invoke your code and make your assertions

Contact.onLoad();
expect(Xrm.Page.getAttribute("new_havingfun").getValue()).toBe(true);

Example

This example demonstrates a script with an onLoad event handler registered on a contact form. When invoked, it changes the firstname attribute's value to Bob. See the Wiki for a visual demo.

src/contact.ts

export default class Contact {
 public static onLoad() {
   Xrm.Page.getAttribute("firstname").setValue("Bob");
 }
}

test/contact.test.ts

import Contact from "../src/contact";
import { XrmMockGenerator } from "xrm-mock";

describe("Contact", () => {
  beforeEach(() => {
    XrmMockGenerator.initialise();
    XrmMockGenerator.Attribute.createString("firstname", "Joe");
  });

  it("should initially be called Joe", () => {
    let name = Xrm.Page.getAttribute("firstname").getValue();
    expect(name).toBe("Joe"); // Pass
  });

  it("should change name to Bob onLoad", () => {
    Contact.onLoad();
    let name = Xrm.Page.getAttribute("firstname").getValue();
    expect(name).toBe("Bob"); // Pass
  });
});

Contribute

  • Submit bugs
  • Implement a new function by inheriting @types/Xrm
    • Test your code using npm run test
    • Lint your code using npm run lint
    • Build your code using npm run build

Roadmap

  • Increased test coverage
  • Increased implementation against different versions of @types/Xrm (8.2 and 9)
  • Automatic generation of attributes from a given Dynamics organisation
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].