Skip to content

-added a test to check the error from the issue 1820 #1832

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

Closed
wants to merge 6 commits into from
Closed

-added a test to check the error from the issue 1820 #1832

wants to merge 6 commits into from

Conversation

Bastczuak
Copy link

…happen.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@Bastczuak Bastczuak mentioned this pull request Apr 23, 2021
]
const router = new VueRouter({ routes })
// and this will not work with shallowMount because router view gets stubbed! How can I just test mount?
const wrapper = mountingMethod(
Copy link
Member

@lmiller1990 lmiller1990 Apr 26, 2021

Choose a reason for hiding this comment

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

mountingMethod is both mount and shallowMount. We run all tests for both. If you don't want to run the test for one, just import the one you want on line 2 from packages/src/test-utils. Or you can do a check with the doNotTestIf helpers.

Copy link
Author

Choose a reason for hiding this comment

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

ok done that.

@Bastczuak Bastczuak changed the title -added a test to check the error from the issue 1820, but the error won't … -added a test to check the error from the issue 1820 Apr 26, 2021
@lmiller1990
Copy link
Member

Thanks, I'll look at this today!

// ignore the functional component if its a RouterView
// Find a good explanation comment why tahts the case, please help!
const componentInstance =
node[FUNCTIONAL_OPTIONS]?.name === 'RouterView'
Copy link
Member

Choose a reason for hiding this comment

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

Can we have an extra check? Just to be sure:

node[FUNCTIONAL_OPTIONS] && node[FUNCTIONAL_OPTIONS].name

I am not sure if we have ? enabled in this code base or not.

Copy link
Member

Choose a reason for hiding this comment

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

Edit: we do not - that's why CI is failing to build. Let's do it old school for now with the && check.

Copy link
Author

Choose a reason for hiding this comment

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

okok

Copy link
Author

Choose a reason for hiding this comment

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

sorry for that, it worked in the tests, that's why I assumed it's generally working.

Copy link
Member

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Please add an extra check! thanks.

I should not use ? operator because it's not compatible in the build process.
@Bastczuak
Copy link
Author

@lmiller1990 ok I added the extra check.

Omg I forgot to remove the ? operator the first time.
@Bastczuak
Copy link
Author

@lmiller1990 Dude I am in despair... I can't understand why the karma test are failing and the jest test not. They are almost the same test case. I really really have no idea.

@lmiller1990
Copy link
Member

The only test failing is the one using the router. This PR makes a change that specifically adds a check against RouterView on this line. I guess we broke something?

I will try taking a look at this on the weekend. I'd suspect if you comment out that check, the Karma tests will pass. That's the first thing I'm going to do - figure out if this failure is due to a change we made, or not.

@Bastczuak Bastczuak closed this Apr 30, 2021
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.

2 participants