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

Class extends value undefined #801

Open
Athoh opened this issue Nov 25, 2022 · 0 comments
Open

Class extends value undefined #801

Athoh opened this issue Nov 25, 2022 · 0 comments

Comments

@Athoh
Copy link

Athoh commented Nov 25, 2022

Hello,

I am getting error

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

      at Object.<anonymous> (../node_modules/supertest/lib/test.js:15:20)
      at Object.<anonymous> (../node_modules/supertest/index.js:14:14)

When trying to run supertest on my app. through jest --silent
supertest version -> 6.3.1

Test code

import supertest from 'supertest';
import app from './app';

describe('App', () => {
  it('should reach /', () =>
    supertest(app)
      .get('/')
      .expect('Content-Type', /json/)
      .expect(200));
});

jest config:

"jest": {
    "setupFilesAfterEnv": [
      "<rootDir>/../jest.setup.ts"
    ],
    "moduleNameMapper": {
      "^@airbus/lib-transfo-utils/(.+)$": "@airbus/lib-transfo-utils/dist/$1/index.js"
    },
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".spec.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "testEnvironment": "node",
    "coverageDirectory": "../coverage",
    "coveragePathIgnorePatterns": [
      "/node_modules/"
    ],
    "collectCoverage": true,
    "coverageThreshold": {
      "global": {
        "branches": 90,
        "lines": 90,
        "statements": 90,
        "functions": 90
      },
      "**/*.ts": {
        "branches": 50,
        "lines": 50,
        "statements": 50,
        "functions": 80
      }
    }
  }

Do anyone as any idea on root cause and how to fix ?

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

No branches or pull requests

1 participant