aws-solutions / serverless-bot-framework

A solution which enables a multilingual conversational platform, facilitating the creation of applications using voice and text
https://aws.amazon.com/answers/machine-learning/serverless-bot-framework/
Other
43 stars 26 forks source link

Tests failing due to missing "moduleFileExtensions": ["js"] #22

Closed kevinschwarz closed 3 years ago

kevinschwarz commented 3 years ago

A clear and concise description of what the bug is.

Details:

/home/ec2-user/environment/serverless-bot-framework/source/infrastructure/test/corelambda-construct.test.ts:13
import { SynthUtils } from '@aws-cdk/assert';
       ^

SyntaxError: Unexpected token {

  at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)

FAIL test/cognito-api-lambdas-construct.test.ts ● Test suite failed to run

Jest encountered an unexpected token

Steps to reproduce the behavior

  1. Step One: clone repo into a fresh cloud9 environment
  2. Step Two: run the tests shell script
  3. [...]

Expected Result

A clear and concise description of what you expected to happen. Exptected tests to pass

Actual Result

A description of what is the result and/or error messages you got when you faced this issue. Test Suites: 10 failed, 10 passed, 20 total

Other information:

  1. Version of the Solution (e.g., v1.1.0):

    To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "(SO0027) AWS Serverless Bot Framework v1.2.0 - This AWS CloudFormation template helps you provision the AWS Serverless Bot Framework stack without worrying about creating and configuring the underlying AWS infrastructure". If the description does not contain the version information, you can look at the mappings section of the template:

Mappings:
  Solution:
    Data:
      ID: SO0027
      Version: 'v1.2.0'
  1. Region where CloudFormation template is deployed (e.g., us-east-1):
  2. Did you make any change in the source code? If yes, what are the relevant changes (if publicly available)?:
  3. Troubleshooting steps attempted:
  4. Were there any errors in the Cloudwatch logs?:
  5. Screenshots (please DO NOT include sensitive information):
  6. Did you use the Sample Weather Service (please DO NOT include API KEY) ? Yes / No

Stack Parameters

Cloudformation Stack Parameters (please DO NOT include sensitive information like S3 bucket name, IP address, credentials, etc):

  1. Bot Name:
  2. Bot Language:
  3. Bot Gender:

Additional context

Add any other context about the problem here.

mohsenari commented 3 years ago

@kevinschwarz Thanks for bringing this to our attention. I recreated the steps and confirm this is a bug. We're working on resolving it and will publish the fix as soon as possible.

mohsenari commented 3 years ago

In the mean time if you want to fix the unit tests for yourself, I suggest adding a jest.config.js file just like the one we have in version 1.5.0. It should resolve this issue.

aassadza commented 3 years ago

Issue is addressed by including the missing jest.config.js file in this commit. Thanks @kevinschwarz for raising the issue.