Hi!
I'm working in a React application which uses api-ai-client to integrate dialogflow features.
Everything works as espected when I manually test the application, but when I try to create some automated tests (with jest), I get the following error, just trying to render the component (which includes api-ai-client)
FAIL __tests__/unit/App.test.js
● Test suite failed to run
/BAR/WORKSPACE/TMP/react-api-ai-poc/node_modules/api-ai-javascript/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export * from "./es6/ApiAiClient";
^^^^^^
SyntaxError: Unexpected token export
4 | const doSendMessage = async (message, token) => {
5 | let ret = null;
> 6 | try {
8 | const client = new ApiAiClient({accessToken: token});
Can anybody please tell me the steps to integrate this api (and to mock it if possible) ?
Hi! I'm working in a React application which uses api-ai-client to integrate dialogflow features. Everything works as espected when I manually test the application, but when I try to create some automated tests (with jest), I get the following error, just trying to render the component (which includes api-ai-client)
Can anybody please tell me the steps to integrate this api (and to mock it if possible) ?
// .babelrc
Also tried in jest.config
Regards,