How to add the TestFairy ionic 2 application

455 views Asked by At

My code is here,

// app.component.ts

public TestFairy: TestFairy;

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

Its through the Error for TestDairy

2

There are 2 answers

1
Sathyanarayanan On BEST ANSWER

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

2
Yuval Goldstein On

See the TestFairy documentation for ionic.

It's also recommended to add this plugin to enable logs on ios 10.x:

ionic plugin add cordova-plugin-console

Thanks, Yuval.