Search code examples
angularionic2testfairy

How to add the TestFairy ionic 2 application


My code is here,

// app.component.ts

public TestFairy: TestFairy;

platform.ready().then(() => {
   TestFairy.begin(APP TOKEN);
   ...
});

Its through the Error for TestDairy


Solution

  • Try This

    // app.componenet.ts

    /// <reference path="../plugins/com.testfairy.cordova-plugin/www/testfairy.d.ts" />
    

    Right after the imports, add the following line to import TestFairy

    declare var TestFairy: TestFairy;
    

    Inside the constructor

    platform.ready().then(() => {
    TestFairy.begin(APP TOKEN);
      ...
    });
    

    Please refer this link : https://docs.testfairy.com/Integrations/Cordova.html