jest-dynamodb icon indicating copy to clipboard operation
jest-dynamodb copied to clipboard

Test suite failed to run caused by TypeError

Open EltonChou opened this issue 1 year ago • 1 comments

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"
  }

EltonChou avatar Mar 11 '23 15:03 EltonChou