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

Update tests to work with newest node LTS #79

Open
CluEleSsUK opened this issue Mar 14, 2024 · 5 comments · May be fixed by #89
Open

Update tests to work with newest node LTS #79

CluEleSsUK opened this issue Mar 14, 2024 · 5 comments · May be fixed by #89
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@CluEleSsUK
Copy link
Contributor

All the jest-http-mock tests fail on the latest LTS version of node, as they appear to use actual fetch rather than the mock (presumably because fetch is now available on LTS)

@CluEleSsUK CluEleSsUK added bug Something isn't working good first issue Good for newcomers labels Mar 14, 2024
@paschal533
Copy link

Hi @CluEleSsUK, I'm interested in working on this issue. I'm from PLDG, and I have experience with Node.js and Jest. Could you please assign this issue to me?

@CluEleSsUK
Copy link
Contributor Author

done @paschal533 - thanks for your help!!

@paschal533
Copy link

Hi @CluEleSsUK

I cloned the project and ran the tests on Node.js version 22.13.0. The only tests that initially failed were:

test('Beacon fetching works with testnet', async () => {
  await endToEndTest('https://pl-us.testnet.drand.sh');
});

test('Beacon fetching works with mainnet', async () => {
  await endToEndTest('https://api.drand.sh');
});

However, after adding testTimeout: 30000 to the jest.config.ts file, all tests passed successfully. Here's the updated configuration:

module.exports = {
  preset: "ts-jest",
  testEnvironment: "node",
  testTimeout: 30000,
  transform: {
    "^.+\\.ts?$": "ts-jest",
  },
  transformIgnorePatterns: ["<rootDir>/node_modules/"],
};

Could you confirm if the issue lies elsewhere or if there’s additional context I might be missing? I'd be happy to investigate further if needed.

@CluEleSsUK
Copy link
Contributor Author

interesting! Could you try updating the GitHub action to run on a newer version and see if it builds successfully?
I don’t have any extra context other than it failed when I tried it heh

@paschal533 paschal533 linked a pull request Jan 21, 2025 that will close this issue
@paschal533
Copy link

Hi @CluEleSsUK

I’ve updated the GitHub Action to use Node.js version 22.x and created a pull request to test the pipeline. The tests ran successfully with this change, including the previously failing ones.

Would you like me to proceed with any further updates or optimizations?

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

Successfully merging a pull request may close this issue.

2 participants