Skip to content

TypeError: this.handlers[[satoriResult.match,this.alexa.handler.state].join(...)].call is not a function #5

@hideokamoto

Description

@hideokamoto

I've try to use the library to test my Alexa skill, but I saw some error.
repo: https://github.com/hideokamoto/alexa-test-practice/tree/kuchimane

$ node -v
v10.1.0

Reproduce

$ git clone git@github.com:hideokamoto/alexa-test-practice.git
$ cd alexa-test-practice/lambda/custom
$ npm i
$ npm test

  4 passing (16ms)
  1 failing

  1) e2e
       greet:
     TypeError: this.handlers[[satoriResult.match,this.alexa.handler.state].join(...)].call is not a function
      at Kuchimane.listen (node_modules/kuchimane/dist/bundle.js:145:83)
      at /Users/dc_hideokamoto/develop/node/alexa/unit-test/lambda/custom/node_modules/kuchimane/dist/bundle.js:150:58
      at Context.it (tests/e2e/index.test.js:15:7)

test code

const kuchimane = require('kuchimane')
const Kuchimane = kuchimane.default
const assert = require('power-assert')
const LaunchRequest = require('../../handlers/LaunchRequest')
const HelloWorldIntent = require('../../handlers/HelloWorldIntent')

const kuchimaneRunner = Kuchimane.runner({ LaunchRequest, HelloWorldIntent }, `${__dirname}/kuchimane_config.json`)

describe('e2e', () => {
  it('greet', () => {
    return kuchimaneRunner.talkCheck('Open greeter', (replyMessage) => {
      console.log(replyMessage)
      assert.deepEqual(replyMessage, 'Welocome to GreetingBot')
    })()
      .then(kuchimaneRunner.talkCheck('Hello', (replyMessage) => {
        assert.deepEqual(replyMessage, 'Hello! Good day')
      }))
  })
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions