Skip to content

test: add parse-tsconfig spec#397

Merged
ezolenko merged 3 commits intoezolenko:masterfrom
agilgur5:test-parse-tsconfig
Aug 19, 2022
Merged

test: add parse-tsconfig spec#397
ezolenko merged 3 commits intoezolenko:masterfrom
agilgur5:test-parse-tsconfig

Conversation

@agilgur5
Copy link
Copy Markdown
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 force-pushed the test-parse-tsconfig branch from b30532d to 53b11df Compare July 22, 2022 23:50
@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.

2 participants