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: migrate cli tap tests to jest #2351

Closed
wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 9, 2021

WIP

Follow up to #2343 and #2265

system/cli.test.ts contains a bunch of tests ranging from auth, test, monitor, policy and more. There are issues with how they setup and cleanup which causes a single test failure to fail the rest of them. Likely because they use Restify via cli-server which isn't supported in Node 16 (see #2265). So I've started migrating them to Jest and fake-server.

Auth in Tests

A lot of tests use snyk config to setup/teardown authentication. These need to be migrated to env vars as snyk config uses a global config file causing cross-test pollution. One simple option is to make the config path configurable.

To Do

  • Split up PRs. There's a few improvements here that came about from fixing various things.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2021

Warnings
⚠️

Since the CLI is unifying on a standard and improved tooling, we're starting to migrate old-style imports and exports to ES6 ones.
A file you've modified is using either module.exports or require(). If you can, please update them to ES6 import syntax and export syntax.
Files found:

  • src/cli/commands/protect/wizard.ts
  • src/lib/snyk-test/run-test.ts
  • test/acceptance/docker-token.test.ts
  • test/system/auth.test.ts
  • test/system/cli.test.ts
Messages
📖 You are modifying something in test/smoke directory, yet you are not on the branch starting with smoke/. You can prefix your branch with smoke/ and Smoke tests will trigger for this PR.

Generated by 🚫 dangerJS against 6b6ae86

@ghost ghost mentioned this pull request Nov 25, 2021
4 tasks
@ghost ghost force-pushed the test/migrate-cli-test-to-jest branch from 8b4c2d8 to bebac90 Compare November 30, 2021 12:16
@ghost ghost changed the title test: migrate cli test to jest test: migrate cli tap tests to jest Nov 30, 2021
@ghost ghost force-pushed the test/migrate-cli-test-to-jest branch 5 times, most recently from bb0cc2c to 86177cc Compare November 30, 2021 15:48
@ghost ghost force-pushed the test/migrate-cli-test-to-jest branch from 86177cc to 6b6ae86 Compare November 30, 2021 16:24
@ghost ghost mentioned this pull request Dec 2, 2021
@ghost ghost closed this Mar 25, 2022
@darscan darscan deleted the test/migrate-cli-test-to-jest branch January 20, 2023 18:01
This pull request was closed.
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

Successfully merging this pull request may close these issues.

0 participants