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

Test suite failed to run caused by TypeError #200

Open
EltonChou opened this issue Mar 11, 2023 · 1 comment
Open

Test suite failed to run caused by TypeError #200

EltonChou opened this issue Mar 11, 2023 · 1 comment

Comments

@EltonChou
Copy link

Got error in Windows.
Need to modify _jestEnvironmentNode.TestEnvironment to _jestEnvironmentNode.

  ● Test suite failed to run

    TypeError: Class extends value undefined is not a constructor or null

      at Object.<anonymous> (node_modules/@shelf/jest-dynamodb/lib/environment.js:7:73)
      at Object.newLoader (node_modules/pirates/lib/index.js:141:7)
      at ScriptTransformer.requireAndTranspileModule (node_modules/@jest/transform/build/ScriptTransformer.js:892:66)
"use strict";

var _jestEnvironmentNode = require("jest-environment-node");
/* eslint-disable no-console */

const debug = require('debug')('jest-dynamodb');
module.exports = class DynamoDBEnvironment extends _jestEnvironmentNode.TestEnvironment {
  constructor(config, context) {
    super(config, context);
  }
  async setup() {
    debug('Setup DynamoDB Test Environment');
    await super.setup();
  }
  async teardown() {
    debug('Teardown DynamoDB Test Environment');
    await super.teardown();
  }

  // @ts-ignore
  runScript(script) {
    // @ts-ignore
    return super.runScript(script);
  }
};
"devDependencies": {
    "@aws-sdk/types": "^3.289.0",
    "@shelf/jest-dynamodb": "^3.4.1",
    "@types/aws-lambda": "^8.10.92",
    "@types/jest": "^27.4.0",
    "@types/jws": "^3.2.5",
    "@types/node": "^17.0.13",
    "@typescript-eslint/eslint-plugin": "^5.10.2",
    "@typescript-eslint/parser": "^5.10.2",
    "esbuild": "^0.17.11",
    "esbuild-jest": "^0.5.0",
    "eslint": "^8.8.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "jest": "^27.5.0",
    "module-alias": "^2.2.2",
    "prettier": "^2.5.1",
    "ts-node": "^10.4.0",
    "tsconfig-paths": "^4.1.2",
    "typescript": "^4.5.5"
  },
  "dependencies": {
    "aws-sdk": "^2.1333.0",
    "jws": "^4.0.0"
  }
@JacerOmri
Copy link

I tried installing jest-environment-node as dev dependency and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants