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

Bypass updates #306

Merged
merged 3 commits into from
Aug 9, 2020
Merged

Bypass updates #306

merged 3 commits into from
Aug 9, 2020

Conversation

tschaub
Copy link
Owner

@tschaub tschaub commented Aug 9, 2020

This is a follow-up to #304.

@tschaub tschaub merged commit f004073 into master Aug 9, 2020
@tschaub tschaub deleted the bypass-updates branch August 9, 2020 22:19
@3cp
Copy link
Collaborator

3cp commented Aug 9, 2020

Instead of playing _mockedBinding, it's probably cheaper and less code if we use a boolean flag on realBinding to temporarily disable mocking.

@tschaub
Copy link
Owner Author

tschaub commented Aug 10, 2020

It looks like there will be more to do to get bypass fully working. fs.createWriteStream doesn't work with the current implementation, and process.cwd() and process.chdir() will produce unexpected results.

@3cp
Copy link
Collaborator

3cp commented Aug 10, 2020

The patches for cwd/chdir/createWriteStream/binding should all check the same _mockedBinding (or a flag) on realBinding. This also means we only need to patch them once without real restore.

The restore (not just for bypass) only needs to remove _mockedBinding (and the flag).

I will create a draft.

@3cp
Copy link
Collaborator

3cp commented Aug 10, 2020

Could you merge #303 first?

3cp added a commit that referenced this pull request Aug 13, 2020
All the patches now check same realBinding._mockedBinding. This should
fix the edge cases around the new feature bypass().

follows up #306
3cp added a commit that referenced this pull request Aug 15, 2020
All the patches now check same realBinding._mockedBinding. This should
fix the edge cases around the new feature bypass().

follows up #306
3cp added a commit that referenced this pull request Aug 15, 2020
All the patches now check same realBinding._mockedBinding. This should
fix the edge cases around the new feature bypass().

follows up #306
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

2 participants