question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bumping to Projen ^0.60.0 causes Jest Test failure for Python Projects

See original GitHub issue

I have a Jest Test that creates a new Python Project as follows:

import { PythonProject } from "projen/lib/python";
...

const pyProject = new PythonProject({
      outdir: "packages/test",
      authorEmail: "test@test.com",
      authorName: "test",
      moduleName: "py_subproject",
      name: "py-subproject",
      version: "0.0.0",
    });

When I run this test I get the following error:

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

      at Object.<anonymous> (../../node_modules/projen/src/awscdk/awscdk-app-py.ts:41:38)
      at Object.<anonymous> (../../node_modules/projen/src/awscdk/index.ts:3:1)

What is very strange is that projen/src/** does not exist in node_modules and nowhere in my code am I creating an awscdk-app-py.

This occurs when bumping versions to ^0.60.0 and is caused by this commit: https://github.com/projen/projen/commit/e5cc5145861b02ce9531e86215d826f60970909c

Strangely, if I change the import to a require the error is no longer thrown.

@marciocadev - Any idea what could be causing this? The only thing I can think of is there was an import change here: https://github.com/projen/projen/commit/e5cc5145861b02ce9531e86215d826f60970909c#diff-f937db55ea61185db729e05de728cb8d1c6f778873317aa2ae35945b24b812e2L10

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
agdimechcommented, Aug 8, 2022

@marciocadev I’m concerned we didn’t catch this in the original PR. Are we missing some tests here?

We can potentially create an e2e tests package which runs as part of CI and deploys the to be released version of projen to an in memory verdaccio. We can then synth projects for core types and verify everything works as it should?

0reactions
marciocadevcommented, Aug 8, 2022

I think to catch this error we have to make tests with imports from folder and from specific files

I can include more tests like this and I think all projects who extends from base languages projects need this kind of tests

Read more comments on GitHub >

github_iconTop Results From Across the Web

nx test: Jest unit tests are failing to run in any test that ... - GitHub
Current Behavior An NX - Ionic and Vue workspace fails to run tests, many solutions tested and any seems to fix the issue:...
Read more >
agdimech (agdimech) - PullAnswer
Bumping to Projen ^0.60.0 causes Jest Test failure for Python Projects. 0 Likes 6 Replies. © 2022 pullanswer.com - All rights reserved.
Read more >
Projen NPM - npm.io
projen synthesizes project configuration files such as package.json ... Standard npm scripts like compile , build , test , package; eslint; Jest ......
Read more >
Angular jest test bpmnModeler error - Modeler - Forum - bpmn.io
Hi, I use bpmn-js in Angular, Jest used by angular for testing code, and when testing the code, an error occurs with the...
Read more >
projen: Versions - Openbase
release: publish to npm workflow fails when set project package manager to PNPM ... python project dependencies when running Jest Test (#2018) (cf51eaf), ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found