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: add parse-tsconfig spec #397

Merged
merged 3 commits into from Aug 19, 2022
Merged

Conversation

agilgur5
Copy link
Collaborator

@agilgur5 agilgur5 commented Jul 22, 2022

Summary

Adds unit tests for a few scenarios of parse-tsconfig.ts

Details

  • test passing tsconfig, buggy tsconfig, non-existent tsconfig, and not a tsconfig

  • clean: "failed to read" error will never happen as we already checked for existence of the file earlier

    • so remove the undefined check and instead use a non-null assertion (plus a comment explaining it)
  • refactor: move the integration test for tsconfig error into this unit test instead

    • faster / more efficient / more precise
  • refactor: split out a makeOptions func that creates default plugin options to use in tests

    • similar to makeStubbedContext

Future Work

@agilgur5 agilgur5 added kind: internal Changes only affect the internals, and _not_ the public API or external-facing docs scope: tests Tests could be improved. Or changes that only affect tests labels Jul 22, 2022
- test passing tsconfig, buggy tsconfig, non-existent tsconfig, and not a tsconfig
- clean: "failed to read" error will never happen as we already checked for existence of the file earlier
  - so remove the `undefined` check and instead use a non-null assertion (plus a comment explaining it)

- refactor: move the integration test for tsconfig error into this unit test instead
  - faster / more efficient / more precise

- refactor: split out a `makeOptions` func that creates default plugin options to use in tests
  - similar to `makeStubbedContext`
@agilgur5 agilgur5 added the topic: OS separators Path normalization between OSes. Windows = '\', POSIX = '/'. Rollup resolve = native, TS = POSIX label Jul 22, 2022
@ezolenko ezolenko merged commit d286015 into ezolenko:master Aug 19, 2022
@agilgur5 agilgur5 deleted the test-parse-tsconfig branch July 2, 2023 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: internal Changes only affect the internals, and _not_ the public API or external-facing docs scope: tests Tests could be improved. Or changes that only affect tests topic: OS separators Path normalization between OSes. Windows = '\', POSIX = '/'. Rollup resolve = native, TS = POSIX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants