Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 10 17:39
    dependabot[bot] labeled #137
  • Aug 10 17:39
    dependabot[bot] opened #137
  • Aug 10 17:39

    dependabot[bot] on npm_and_yarn

    Bump path-parse from 1.0.5 to 1… (compare)

  • Jun 10 16:37
    btburton42 commented #115
  • Jun 07 21:51
    jkelvie commented #115
  • May 09 23:41
    dependabot[bot] labeled #136
  • May 09 23:41
    dependabot[bot] opened #136
  • May 09 23:41

    dependabot[bot] on npm_and_yarn

    Bump hosted-git-info from 2.7.1… (compare)

  • May 07 01:17
    dependabot[bot] labeled #135
  • May 07 01:17
    dependabot[bot] opened #135
  • May 07 01:17

    dependabot[bot] on npm_and_yarn

    Bump underscore from 1.9.1 to 1… (compare)

  • May 06 20:48

    dependabot[bot] on npm_and_yarn

    (compare)

  • May 06 20:48
    dependabot[bot] closed #125
  • May 06 20:48
    dependabot[bot] commented #125
  • May 06 20:48
    dependabot[bot] labeled #134
  • May 06 20:48
    dependabot[bot] opened #134
  • May 06 20:48

    dependabot[bot] on npm_and_yarn

    Bump lodash from 4.17.15 to 4.1… (compare)

  • May 06 17:25
    dependabot[bot] labeled #133
  • May 06 17:25
    dependabot[bot] opened #133
  • May 06 17:25

    dependabot[bot] on npm_and_yarn

    Bump handlebars from 4.5.3 to 4… (compare)

allthepies
@allthepies
Hi Guys. I 'm using the virtual-alexa dynamoDB mock and want to pre-populate the mocked dynamo table with a set of attributes at the start of a test. Is this possible ?
John Kelvie
@jkelvie
Hi @allthepies - if you activate the mock, and then make call to DynamoDB put - either directly via the API or via the AWS SDK, it will set the state of the table
allthepies
@allthepies
Hi, Tried calling PutItem on the AWS DynamoDB class after enabling the bespoken dynamo mock and get an exception with the AWS call asking for a region
allthepies
@allthepies
Sorted now, had the execution order wrong
John Kelvie
@jkelvie
Great....glad to hear it
Dan
@dhazrati_twitter
Hello :wave: Has anybody experiences issues setting environment variables with virtual-alexa? I'm currently running unit tests with this lib and Jest, but for some reason, any custom process.env.FOO env vars are not being picked up from my node Lambda locally. Any ideas?
John Kelvie
@jkelvie
Hi @dhazrati_twitter how is your Lambda being invoked?
Dan
@dhazrati_twitter

Hi @jkelvie - the Lambda handler is being invoked as a JS function directly.

import { handler } from 'src/index';
import { VirtualAlexa } from 'virtual-alexa';
const alexa = VirtualAlexa.Builder()
    .handler(handler)
    ...
   . build()

I've tried setting the env variables before and after the virtual alexa client is built, but no luck. I can only seem to set variables outside of our test file i.e. SOME_VAR=true jest

John Kelvie
@jkelvie
Okay, and where are you setting the environment variable that it does NOT work?
Also, I take it that it does work if it is set in the CLI via an export?
Dan
@dhazrati_twitter

@jkelvie Yes you're correct. It works when the environment variable is exported as part of my test command e.g. FOO=BAR npm run test.

My Jest test file looks something like this:

import { handler } from 'src/index';
import { VirtualAlexa } from 'virtual-alexa';

describe("Given some state", () => {
  beforeEach(async () => {
    process.env.FOO = "bar";

    const alexa = VirtualAlexa.Builder().handler(handler).build();
    await alexa.launch();
  })

  it("Then some expection", () => {
    expect("something").toBe("something")
  })
})

This is not currently working, as the environment variable is NOT picked up inside my handler.

I will try and create a minimal reproduction this weekend, if that will help?
John Kelvie
@jkelvie
Yes, that would be helpful. I can't think of what would cause this - especially given the example you show above.
I naturally tend to focus on the process-spawning that Jest does, but that would not apply in the sample code you show.
Dan
@dhazrati_twitter
Hi @jkelvie, I tried to create a minimal reproduction.... and couldn't.... so I decided to take another look at the original code and spotted a bug in our code (facepalm). Apologies and thanks for taking a look!
John Kelvie
@jkelvie
Glad to hear that it's working, @dhazrati_twitter !
allthepies
@allthepies
Hi, I've got the latest virtual alexa installed (0.7.7) and the inSkillPurchaseResponse() method doesn't exist in the SkillRequest object. Has the package been generated correctly ?
allthepies
@allthepies
Actually the latest using npm install is 0.7.5. Tried both and they don't have the ISP support....
Diego Martín
@dmarvp
Hi @allthepies, we just published a new version that should fix your issue. Please let us know if the problem persists.
allthepies
@allthepies
Hi, yes the method is now there! However when I use it, no session is present in the alexa request and so my code (which expects one) fails. Is this an error in virtual alexa or do I need to add session data to the request prior to sending ?
allthepies
@allthepies
OK, I've added a session object using the same request() and it works, nearly! You have a bug in your Connections.Response code, the status.code value should be a string e.g. "200" whereas your code uses a numeric, 200. My code performs a type-safe check on the status code and rejects the numeric 200. You can find the Amazon documentation for the request here -> https://developer.amazon.com/en-US/docs/alexa/in-skill-purchase/add-isps-to-a-skill.html
Ashish Jha
@TheDreamSaver

Hi

@dmarvp @jkelvie

I was trying to run the https://gitlab.com/bespoken/utterance-testing-recipe locally, but was getting this error

> utterance-testing-recipe@0.1.0 utterances /mnt/c/Users/thedreamsaver/Downloads/utterance-testing-recipe-master
> bbt process input/utterance-test.json

command: process arg: input/utterance-test.json
No device-pool provider specified - using default.
DEVICE create token: google-3a592bde-0dcf-43a9-9c90-5910223643dd skipSTT: false tags:
Config loading class: ./csv-source using paths: /mnt/c/Users/thedreamsaver/Downloads/utterance-testing-recipe-master,/mnt/c/Users/thedreamsaver/Downloads/utterance-testing-recipe-master/node_modules/bespoken-batch-tester/src for service: source
CSV-SOURCE LOADALL input file: input/utterances.csv
BATCH READ pre-filter: 4 post-filter: 4
DEVICE LOCK tags:  count: 1
DEVICE LOCK acquire tags:  available: 0 token: google-3a592bde-0dcf-43a9-9c90-5910223643dd
RUNNER PROCESS run: utterance-tester_2021-04-27T20-21-42 utterance: search for museums near me
DEVICE LOCK tags:  count: 0
Config loading class: ./src/utterance-interceptor using paths: /mnt/c/Users/thedreamsaver/Downloads/utterance-testing-recipe-master,/mnt/c/Users/msi/Downloads/utterance-testing-recipe-master/node_modules/bespoken-batch-tester/src for service: interceptor
DEVICE MESSAGE error: invalid literal for boolean. Not a string. retrying 10 seconds
DEVICE MESSAGE error: invalid literal for boolean. Not a string. retrying 10 seconds
when i run
npm run utterances
John Kelvie
@jkelvie
Hi Ashish, the version of the batch-tester being used in that project was outdated. I just updated it to the newer version. If you pull the latest version of the project, it should work for you.
Ashish Jha
@TheDreamSaver
Thanks John! It works now!