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

fix(nonGlobalStepDefinitions): .features files now work with webpack #404

Conversation

sebastiandero
Copy link

@sebastiandero sebastiandero commented Jul 2, 2020

I have tried with our project (80+ scenarios) they now seem to work.

tests in the repo also pass (some dont because of windows vs linux path slashes, but that was the case before)

#304

@badeball
Copy link
Owner

badeball commented Jul 2, 2020

It seems like this conditionally removes the cache busting in case Weback is detected. The cache busting is however important and serves a particular purposes when using nonGlobalStepDefinitions: true. Are you using it with true or false?

@sebastiandero
Copy link
Author

sebastiandero commented Jul 2, 2020

@badeball

{
    "stepDefinitions": "src/integration",
    "nonGlobalStepDefinitions": true
}

this is what i tested with

EDIT: here's what I based my test on ->

What actually happens here I believe is we need to make sure that importing the same file twice runs it's side effects, instead of just getting the cached export otherwise if you use the same file in nonGlobal feature things are not working right. It'd be easy to test by making that clearFromCache function empty and seeing how webpack behaves - maybe things will just work? (although I doubt it)

@sebastiandero
Copy link
Author

@badeball i've just encountered some weird behavior, let me have another look

@sebastiandero sebastiandero force-pushed the feature/fix-webpack-features-support branch from 65ee0a4 to c789554 Compare July 2, 2020 20:43
@sebastiandero
Copy link
Author

@badeball if you could do another review, that would be awesome, im now deleting the moduleid entry from require.cache

@sebastiandero sebastiandero force-pushed the feature/fix-webpack-features-support branch from c789554 to 620d22c Compare July 2, 2020 20:51
@badeball
Copy link
Owner

badeball commented Jul 2, 2020

The current state of things is indeed how I imagined it would be. Did it solve the problem you mentioned above?

@sebastiandero
Copy link
Author

@badeball yes it did, now tests run as expected.

@lgandecki lgandecki merged commit 8b92ed3 into badeball:master Jul 3, 2020
@lgandecki
Copy link
Collaborator

Thanks so much for the PR @sebastiandero , glad you got it.
Also, thanks @badeball for a spot on review :-)

@lgandecki
Copy link
Collaborator

🎉 This PR is included in version 2.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants