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

bug: Since v1.7.1 our tests doesn't work anymore [fix with PR #3472] #3471

Closed
3 tasks done
deleonio opened this issue Jul 14, 2022 · 7 comments
Closed
3 tasks done

bug: Since v1.7.1 our tests doesn't work anymore [fix with PR #3472] #3471

deleonio opened this issue Jul 14, 2022 · 7 comments
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil

Comments

@deleonio
Copy link

Prerequisites

Stencil Version

1.7.1

Current Behavior

npm run test

testMatch:  - 0 matches

Expected Behavior

testMatch:  - >0 matches

Steps to Reproduce

Try test exec with v1.7.1 with project should work in v.1.7.0

Code Reproduction URL

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Jul 14, 2022
@deleonio
Copy link
Author

Maybe this changes ... #3444

@deleonio
Copy link
Author

deleonio commented Jul 14, 2022

There is a new Jest args validation and this blocks our test execution:

stencil test --spec --json --outputFile=jest-test-results.json

@deleonio deleonio changed the title bug: v1.7.1 tests does not found bug: Since v1.7.1 our tests doesn't work anymore [fix with PR #3472] Jul 15, 2022
@alicewriteswrongs
Copy link
Member

Hi deleonio, thanks for filing this issue! Would you mind providing a reproduction for the issue you're seeing?

@alicewriteswrongs alicewriteswrongs added the Awaiting Reply This PR or Issue needs a reply from the original reporter. label Jul 15, 2022
@ionitron-bot ionitron-bot bot removed the triage label Jul 15, 2022
@rwaskiewicz rwaskiewicz added ionitron: needs reproduction This PR or Issue does not have a reproduction case URL and removed Awaiting Reply This PR or Issue needs a reply from the original reporter. labels Jul 18, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Jul 18, 2022

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@alicewriteswrongs alicewriteswrongs added Bug: Validated This PR or Issue is verified to be a bug within Stencil and removed ionitron: needs reproduction This PR or Issue does not have a reproduction case URL labels Jul 20, 2022
@alicewriteswrongs
Copy link
Member

I think this is the same issue as #3481

alicewriteswrongs added a commit that referenced this issue Jul 20, 2022
This fixes a bug with how these flags were being parsed which was
messing with Jest. Basically, the issue related to how the `knownArgs`
array on the `ConfigFlags` object was being populated. For CLI key-value
args of the format `--argName=value` the whole string
`"--argName=value"` was being added _as well as_ the value string
`"value"`, which had the effect of passing duplicate args to Jest.

This refactors how such arguments are handled to always parse apart the
argument name and the value, adding only the argument name and then the
argument value, so that if you pass, for instance,
`--outputFile=output.json`, the args passed to Jest will look like

```ts
['--outputFile', 'output.json']
```

See #3471 and #3481 for more details
alicewriteswrongs added a commit that referenced this issue Jul 20, 2022
This fixes a bug with how these flags were being parsed which was
messing with Jest. Basically, the issue related to how the `knownArgs`
array on the `ConfigFlags` object was being populated. For CLI key-value
args of the format `--argName=value` the whole string
`"--argName=value"` was being added _as well as_ the value string
`"value"`, which had the effect of passing duplicate args to Jest.

This refactors how such arguments are handled to always parse apart the
argument name and the value, adding only the argument name and then the
argument value, so that if you pass, for instance,
`--outputFile=output.json`, the args passed to Jest will look like

```ts
['--outputFile', 'output.json']
```

See #3471 and #3481 for more details
rwaskiewicz pushed a commit that referenced this issue Jul 20, 2022
This fixes a bug with how these flags were being parsed which was
messing with Jest. Basically, the issue related to how the `knownArgs`
array on the `ConfigFlags` object was being populated. For CLI key-value
args of the format `--argName=value` the whole string
`"--argName=value"` was being added _as well as_ the value string
`"value"`, which had the effect of passing duplicate args to Jest.

This refactors how such arguments are handled to always parse apart the
argument name and the value, adding only the argument name and then the
argument value, so that if you pass, for instance,
`--outputFile=output.json`, the args passed to Jest will look like

```ts
['--outputFile', 'output.json']
```

See #3471 and #3481 for more details
@alicewriteswrongs
Copy link
Member

Thanks for reporting this! Just to update you, there's a bugfix PR up here: #3483 which just merged into main.

If you want to test it out to make sure it fixes your issue you could

  • clone the repo locally
  • check out the branch
  • do npm install, npm run build and npm pack
  • try installing the resulting .tgz file in our project by doing npm install ./path/to/stencil.tgz

If you'd rather wait for a pre-release or release build to try that out no worries :)

@rwaskiewicz
Copy link
Member

The fix for this issue has been officially released as a part of Stencil v2.17.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Validated This PR or Issue is verified to be a bug within Stencil
Projects
None yet
Development

No branches or pull requests

3 participants