Erro ao executar test -c chatbot-1

watson-asssistant-public-test@1.0.0 test /Users/arojunior/codenation/chatbot-1
mocha --timeout 1200000 --exit test.js

/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/lib/base_service.js:218
throw new Error(errorMessage);
^

Error: Insufficient credentials provided in constructor argument. Refer to the documentation for the required parameters. Common examples are username/password, api_key, and iam_access_token.
at ConversationV1.BaseService.initCredentials (/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/lib/base_service.js:218:23)
at ConversationV1.BaseService (/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/lib/base_service.js:64:29)
at ConversationV1 [as constructor] (/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/conversation/v1-generated.js:54:28)
at new ConversationV1 (/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/conversation/V1.js:37:24)
at Object. (/Users/arojunior/codenation/chatbot-1/index.js:16:17)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object. (/Users/arojunior/codenation/chatbot-1/test.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at /Users/arojunior/codenation/chatbot-1/node_modules/mocha/lib/mocha.js:250:27
at Array.forEach ()
at Mocha.loadFiles (/Users/arojunior/codenation/chatbot-1/node_modules/mocha/lib/mocha.js:247:14)
at Mocha.run (/Users/arojunior/codenation/chatbot-1/node_modules/mocha/lib/mocha.js:576:10)
at Object. (/Users/arojunior/codenation/chatbot-1/node_modules/mocha/bin/_mocha:637:18)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
npm ERR! Test failed. See above for more details.
2018/09/03 22:43:07
err:
/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/lib/base_service.js:218
throw new Error(errorMessage);
^

Error: Insufficient credentials provided in constructor argument. Refer to the documentation for the required parameters. Common examples are username/password, api_key, and iam_access_token.
at ConversationV1.BaseService.initCredentials (/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/lib/base_service.js:218:23)
at ConversationV1.BaseService (/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/lib/base_service.js:64:29)
at ConversationV1 [as constructor] (/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/conversation/v1-generated.js:54:28)
at new ConversationV1 (/Users/arojunior/codenation/chatbot-1/node_modules/watson-developer-cloud/conversation/V1.js:37:24)
at Object. (/Users/arojunior/codenation/chatbot-1/index.js:16:17)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at Object. (/Users/arojunior/codenation/chatbot-1/test.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at /Users/arojunior/codenation/chatbot-1/node_modules/mocha/lib/mocha.js:250:27
at Array.forEach ()
at Mocha.loadFiles (/Users/arojunior/codenation/chatbot-1/node_modules/mocha/lib/mocha.js:247:14)
at Mocha.run (/Users/arojunior/codenation/chatbot-1/node_modules/mocha/lib/mocha.js:576:10)
at Object. (/Users/arojunior/codenation/chatbot-1/node_modules/mocha/bin/_mocha:637:18)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
at startup (internal/bootstrap/node.js:201:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)
npm ERR! Test failed. See above for more details.

2018/09/03 22:43:07 cmd.Run() failed with exit status 1

Ol√° @arojunior!
Você chegou a configurar o index.js com workspace_id, username e password? (Linhas 18, 19 e 25)

Está escrito no desafio que é preciso configurar isso antes de testar :wink:

A configuração do Watson Assistant também pode ser feita usando o arquivo .env

1 Curtida

Estou tendo o mesmo problema, mesmo após a configuração do .env com as credenciais do Watson. Teria algum exemplo de como seria feita a correta configuração?

@Asp6e4, consegue dar um help para o @lucaspicolloo em relação as credenciais do watson
:smiley:

1 Curtida

Galera, realmente h√° um problema nos arquivos de base.

Para quem já possui uma cópia, o erro é:
No arquivo index.js:

  • Substitua a linha 4, por:
    const conversation = require('watson-developer-cloud/assistant/v1');

@gustavo.comitre irei realizar um pull request para resolver o problema.

2 Curtidas