Skip to content
This repository has been archived by the owner on Apr 13, 2018. It is now read-only.

XrmMockGenerator.initialise is not a function #8

Open
tsharp opened this issue Jan 12, 2018 · 3 comments
Open

XrmMockGenerator.initialise is not a function #8

tsharp opened this issue Jan 12, 2018 · 3 comments

Comments

@tsharp
Copy link

tsharp commented Jan 12, 2018

  × encountered a declaration exception
    Chrome 63.0.3239 (Windows 10 0.0.0)
  TypeError: XrmMockGenerator.initialise is not a function
      at UserContext.beforeEach (test/lead/formSpec.js:77:26)
@daryllabar
Copy link
Contributor

I'm having a similar issue. Below is my TypeScript file. I'm guessing it has to do with how the module loader I'm using?

import * as XrmMockGenerator from "xrm-mock-generator";

describe("Module Xrm-Mock-Generator in node_modules/xrm-mock-generator/src/xrm-mock-generator", () => {
    let xrm: Xrm.XrmStatic;
    beforeEach(() => {
        xrm = XrmMockGenerator.initialize();
        XrmMockGenerator.Attribute.createString("firstname", "Joe");
        XrmMockGenerator.Attribute.createString("lastname", "D365");
    });

    it("getValue should return default value", () => {
        expect(xrm.Page.getAttribute("firstname").getValue()).toBe("Joe");
        expect(xrm.Page.getAttribute("lastname").getValue()).toBe("D365");
    });
});

@tsharp did you figure out a solution?

@davidjbclark
Copy link
Owner

@daryllabar you've written initialize instead of initialise. Having said that I think tsharp's issue still persists.

@daryllabar
Copy link
Contributor

I did catch that (you and the Queen's English...) and finally figured out that v 1.0.6 on npm is invalid. Going back to v1.0.5 worked.

Any Idea Why @camelCaseDave

daryllabar added a commit to daryllabar/xrm-mock-generator that referenced this issue Mar 27, 2018
Updated Attribute Builder calls to return the attribute
davidjbclark added a commit that referenced this issue Mar 27, 2018
Fix for XrmMockGenerator.initialise is not a function #8,
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants