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

Enhance testing #346

Merged
merged 9 commits into from
Aug 11, 2022
Merged

Enhance testing #346

merged 9 commits into from
Aug 11, 2022

Conversation

paescuj
Copy link
Collaborator

@paescuj paescuj commented Aug 10, 2022

  • Upgrade Jest to v28
  • Lint tests with the help of eslint-plugin-jest
  • Solve all lint problems
    • Refactor tests using a promise based approach instead of the "done" callback
    • Run "alias" tests with it.each instead of defining them twice
    • Move expectLinesForProcessStartAndStop & expectLinesForTimingsTable methods to expect.extend
    • Fix & re-enable 'is of success when a SIGINT is sent' test
  • Update all lint / test related dependencies
    • Downgrade @types/node to current active LTS version (v16)
      Generally, it's advised to align types with the Node.js version - since we're targeting multiple Node.js version we pin the types to the current active LTS version
  • Bundle 'concurrently' only once for all tests in bin/concurrently.spec.ts with the help of esbuild
    • Results in faster execution of the tests 🚀
    • Makes it (easier) possible to run the commands without a shell and thus get a correct behavior for the 'SIGINT' test

@coveralls
Copy link

coveralls commented Aug 10, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling 1d73678 on paescuj:test-enhancements into 93e0891 on open-cli-tools:main.

@paescuj paescuj marked this pull request as ready for review August 11, 2022 10:14
@paescuj paescuj merged commit 22f64a1 into open-cli-tools:main Aug 11, 2022
@paescuj paescuj deleted the test-enhancements branch August 11, 2022 10:15
Comment on lines +83 to +84
expect(observerSpy.getValueAt(0)).toEqual({ startDate, endDate: undefined });
expect(observerSpy.getValueAt(1)).toEqual({ startDate, endDate });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice! But it seems it assumes that the observers will emit synchronously... or did I miss anything?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right! Good catch, thanks! I'm going to address this in the next days...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what do you think about this? => #369 😃

src/completion-listener.spec.ts Show resolved Hide resolved
@paescuj paescuj mentioned this pull request Sep 22, 2022
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.

3 participants