When my directory contains these two files -
standard-handlers-unauthorized.test.yml
---
configuration:
locales: en-US
filter: mockGivenNameFilter.js
---
- test: Launch request
- LaunchRequest:
- prompt: Welcome to Star Port 75 Travel.
How can I help you?
- response.card.type: AskForPermissionsConsent
mockGivenNameFilter.js
module.exports = {
onRequest: (test, requestEnvelope) => {
// Removed contents to make it simpler.
}
};
- and I run this command -
bst test --jest.collectCoverage=false standard-handlers-unauthorized.test.yml
- I get this result, and I don't understand it -
Filter specified - but filter module not found at: mockGivenNameFilter.js
I can't replicate the same error message, but I write this example maybe it could help you.
test.yml
---
configuration:
locales: en-US
filter: mockGivenNameFilter.js
---
- test : Test 1
- open weather score :
- prompt :
- "welcome I'm dragonfly"
- What is the weather score for seatle :
- prompt: "*"
- responseFiltered: "false"
- response.card.type: "{mockGivenNameFilter}"
testing.json
{
"platform": "alexa",
"type": "e2e",
"locale": "en-US",
"virtualDeviceToken": "${VIRTUAL_DEVICE_TOKEN}",
"voiceId": "Ivy",
"trace": true,
"asyncMode": true
}
mockGivenNameFilter.js
module.exports = {
onRequest: (test, request) => {
console.log('>>> onRequest: adding "requestFiltered" to the request. This prop will be added to request object.')
request.requestFiltered = "true";
},
onResponse: (test, response) => {
console.log('>>> onResponse: adding "responseFiltered" to the response. This prop will be added to response object.')
response.responseFiltered = "true";
},
resolve: (variable, interaction) => {
console.log('>>> resolve: resolving variable: ', variable)
if (variable === 'mockGivenNameFilter') {
console.log('>>> resolve: setting value for: ', variable)
return 'custom value mockGivenNameFilter'
}
return null
}
};
Reading a variable set on the response:
Reading a computed variable:
Hope it helps (-: