Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.6.0 does not provide an export named 'mockClient' #79

Closed
jbisabel opened this issue Mar 1, 2022 · 1 comment
Closed

v0.6.0 does not provide an export named 'mockClient' #79

jbisabel opened this issue Mar 1, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jbisabel
Copy link

jbisabel commented Mar 1, 2022

Checklist

  • [x ] I have read Caveats documentation and didn't find a solution for this problem there.

Bug description

Since the 0.6.0 version I am getting syntax errors when trying to use the import { mockClient } from 'aws-sdk-client-mock' syntax.

SyntaxError: The requested module 'aws-sdk-client-mock' does not provide an export named 'mockClient'

      at Runtime.linkAndEvaluateModule (node_modules/jest-runtime/build/index.js:779:5)
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)
      at runJest (node_modules/@jest/core/build/runJest.js:404:19)
      at _run10000 (node_modules/@jest/core/build/cli/index.js:320:7)

Environment

  • Node version: 17.3.0
  • Testing lib and version: Jest 27.5.1
  • Typescript version: /
  • AWS SDK v3 Client mock version: 0.6.0
  • AWS JS SDK libs and versions:
    • @aws-sdk/client-rds-data v3.53.0

Minimal example

Running npm run test with the following minimal sample generates the syntax error under v0.6.0 of the library, but runs fine under v0.5.6

package.json

{
    "name": "aws-sdk-client-mock-poc",
    "version": "0.0.1",
    "main": "index.mjs",
    "type": "module",
    "scripts": {
        "test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest"
    },
    "devDependencies": {
        "aws-sdk-client-mock": "^0.6.0",
        "cross-env": "^7.0.3",
        "jest": "^27.5.1"
    },
    "jest": {
        "moduleFileExtensions": [
            "mjs",
            "js"
        ],
        "testMatch": [
            "**/*.test.mjs"
        ]
    }
}

index.test.mjs

import { mockClient } from 'aws-sdk-client-mock'
@jbisabel jbisabel added the bug Something isn't working label Mar 1, 2022
@m-radzikowski
Copy link
Owner

I bumped TypeScript to 4.5.5 in the previous release, and apparently, this caused the problem. I bumped TS to 4.6.2 and it seems to work. I will release v0.6.1 in a moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants