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

pact-js vs. pact-node #408

Closed
basickarl opened this issue Feb 6, 2020 · 3 comments
Closed

pact-js vs. pact-node #408

basickarl opened this issue Feb 6, 2020 · 3 comments

Comments

@basickarl
Copy link

basickarl commented Feb 6, 2020

What is the difference between the pact-js, pact-node and pact-web packages?

We have the following types of code:

  • asynchronous
  • synchronous
  • node.js
  • browser
  • isomorphic

Which package should one choose if doing one of the following in my list?

@mefellows
Copy link
Member

TL;DR - you want Pact JS in most instances.

  • asynchronous - Pact JS
  • synchronous - Pact JS
  • node.js - Pact JS
  • browser - If you actually need it to run in the browser (almost always debateable), Pact Web
  • isomorphic - If you actually need it to run in the browser (almost always debateable), Pact Web

The "I need to run it in the browser" question comes up occasionally. The question is this - for your JS code to be able to make a call to another API, is this dependent on browser-specific code? In most cases, people use tools like React/Angular which have libraries that work on the server and client side, in which case, these tests don't need to run in a browser.

I think this table is a good one, and I'm going to use it as a starting point to publish onto the various repositories to make things clearer.

See also pact-foundation/pact-js-core#145.

This from the Pact Node github home page:

Screen Shot 2020-02-07 at 8 13 13 am

Does this answer your question?

@basickarl
Copy link
Author

@mefellows Perfect! Thank you very muchos!

@mefellows
Copy link
Member

You're welcome. I've just added a first cut at a table. Not sure it's in the right place but it's a start.

@mefellows mefellows mentioned this issue Jul 6, 2020
63 tasks
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

No branches or pull requests

2 participants