Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

fix: fix shellUtils stubbing with ES modules #983

Merged
merged 3 commits into from
Feb 8, 2022
Merged

Conversation

ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Jan 28, 2022

Part of #749

ES modules make stubbing harder. More precisely, it is not possible to stub the top-level variable being exporter/imported (either named or default), only its properties. This is, unlike CommonJS, ES modules are linked at parse-time, not runtime.

To workaround this, in order to migrate to pure ES modules, this PR wrap shellUtils into an object, since it is being stubbed in tests.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code
    🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re
    fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
KinectTheUnknown David-Joseph Xayavong
@ehmicky ehmicky added the type: chore work needed to keep the product and development running smoothly label Jan 28, 2022
@github-actions github-actions bot added the type: bug code to address defects in shipped code label Jan 28, 2022
@ehmicky ehmicky removed the type: bug code to address defects in shipped code label Jan 28, 2022
@ehmicky ehmicky mentioned this pull request Jan 28, 2022
kodiakhq bot added 2 commits February 8, 2022 13:03

Verified

This commit was signed with the committer’s verified signature.
KinectTheUnknown David-Joseph Xayavong

Verified

This commit was signed with the committer’s verified signature.
KinectTheUnknown David-Joseph Xayavong
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2022

⏱ Benchmark results

largeDepsEsbuild: 7.3s

^   7.3s  
│   ┌──┐  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
└───┴──┴──>
     T    
Legend
  • T (current commit): 7.3s

largeDepsNft: 31.1s

^  31.1s  
│   ┌──┐  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
└───┴──┴──>
     T    
Legend
  • T (current commit): 31.1s

largeDepsZisi: 56.8s

^  56.8s  
│   ┌──┐  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
└───┴──┴──>
     T    
Legend
  • T (current commit): 56.8s

@kodiakhq kodiakhq bot merged commit dc12508 into main Feb 8, 2022
@kodiakhq kodiakhq bot deleted the chore/shell-utils branch February 8, 2022 13:12
Skn0tt pushed a commit to netlify/build that referenced this pull request May 21, 2024

Verified

This commit was signed with the committer’s verified signature.
KinectTheUnknown David-Joseph Xayavong
…ip-it#983)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants