Closed jpiyali closed 5 years ago
@hiraldesai - answering your question from my first PR (sent out this pr instead today). Usage:
let reactAI = new ReactAI(); let appInsights = new ApplicationInsights({ config: { instrumentationKey: IKEY, extensions: [reactAI], extensionConfig: { "ApplicationInsightsReactUsage": { debug: false } } } }); appInsights.loadAppInsights();
ReactAIContainer.defaultReactAIContainer = new ReactAIContainer(appInsights, reactAI);
The remaining is as before (withAITracking...). The intent of changing usage is so that customers can continue to incorporate other extensions into the SDK other than just react-appInsights as well.
@hiraldesai , @pviotti - any ideas on how to get rid of the build issue I'm having in the typescript-rewrite branch:
src/ReactAI.ts:73:33 - error TS2345: Argument of type 'History
73 this.addHistoryListener(reactAISettings.history);
src/ReactAI.ts:122:13 - error TS2339: Property 'listen' does not exist on type 'History'.
122 history.listen(
adding History
to the import in ReactAI.ts fixes that problem:
import { Action, History, Location } from "history";
after that it looks like there are some other issues to fix to make the tests pass...
/AzurePipelines help
Supported commands help: Get descriptions, examples and documentation about supported commands Example: help "command_name" run: Run all pipelines or a specific pipeline for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify a pipeline to run. Example: "run" or "run pipeline_name" See additional documentation.
/AzurePipelines run
In addition to what noted by Hiral, 4 tests out of 7 are not passing (and unfortunately for some reason the Pipeline CI build is not triggered on this PR..):
debug
and the initialContext
are not passed to the constructor - hence, the related tests failwithAITracking
seems not to be working either@hiraldesai , @pviotti , do you guys have any instructions for debugging the tests?
Update: @hiraldesai , @pviotti I've fixed all tests, added new ones. They were failing as I had missed calling loadAppInsights() for major part. Had to fix some other spy functions. All tests passing now. I'll be pushing this change in today. Please take a look if you have any other comments.