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(@sounisi5011/stream-transform-from): fix incorrect tests #651

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sounisi5011
Copy link
Owner

@sounisi5011 sounisi5011 commented Jan 8, 2023

  • fix unit test - 78930e3, 95614df
  • fix type test - 4a100b3
  • Test for source argument types - 78b22c8
  • Test the return type
  • Add type utilities test
    • TransformFunction<TOpts>
    • SourceIterator<TOpts>
    • InputChunkType<TOpts>
    • OutputChunkType<TOpts>
  • Generate a combination of stream.TransformOptions for test code and unit tests using the same code

Test "source iterator contains more than just Buffer objects / options: { ... } / transformFrom()" was not extracting `chunk` property from the source iterator.
…inition tests from within unit test code

This code is adding redundant testing.
It probably exists to detect type definition errors.
However, it is not useful as a test of type definitions either.

If type definition tests are needed, we should add them in the `test-d` directory.
…tions related to object mode switching

In addition to changes to the test code, the following changes were made:

+ Add `combinate@1.1.11` to dev dependencies

    Required to automatically generate test case combinations.

+ Update dprint's TypeScript Code Formatter plugin

    Required to use the `satisfies` operator
…ts for `source` argument type definitions

+ Add `build:type-test` and `build:tsc` npm-scripts

    Running the `build:type-test` npm-script will automatically generate tests for type definitions.

+ Create `scripts/generate-type-test-cases.js`

    This script is used to automatically generate tests for type definitions.

+ Create `.lintstagedrc.cjs`

    When committing, if the auto-generated type definition test file or the script file for generation has been modified, the type definition test is automatically generated.

In addition to changes to the test code, the following changes were made:

+ Add `word-join@0.0.1` to dev dependencies

    Within the automatically generated test file, a comment is included to explain the intent.
    This package is used to join words in the text of that comment.
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5114 lines exceeds the maximum allowed for the inline comments feature.

@codeclimate
Copy link

codeclimate bot commented Jan 9, 2023

Code Climate has analyzed commit 78b22c8 and detected 0 issues on this pull request.

View more on Code Climate.

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.

None yet

1 participant