0.0.4 • Published 2 years ago

fetchguy v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

fetchguy

An open-source simple http request test runner built around fetch.

Comparison to Other HTTP Test Runners

MailmanLightningServerFetchGuy
Easy to use
Supports more than just JSON return types
Has likely a lot of funding
Costs you money
Limits the number of collections you can run
Is tracking data on you
Now requires a license to use all features
Is just a http test runner wrapped around fetch

Roadmap

  • Support multiple comparison types
  • Seperate the rendering logic from the test logic to make it easier to maintain
  • Allow for custom tests
  • Write more thorough documentation and examples so people can start using the library
  • Allow for more options in the test runner (delays between calls, allow parallel requests, etc.)

Q&A

Why do this?

I got tired of using the competitors and wanted something simple that was barebones and did what I needed it to. Plain and simple.

Can you give us an example of code

I'm going to write a better example with a public api that could be used for the example, but this is the example syntax:

const runTests = async () => {
  const fetchguy = await import("fetchguy");
  fetchguy.TestRunner([
    {
      title: "Test ping is returning expected values",
      fetchOptions: {},
      url: "http://localhost:8000/ping",
      asserts: [
        {
          comparison: "EQUAL",
          title: "status code is 200",
          propDrilldown: ["status_code"],
          type: "STATUS_CODE",
          value: 201,
        },
        {
          comparison: "EQUAL",
          title: "body has string here",
          propDrilldown: ["inner", "property", "insider"],
          type: "BODY",
          value: "her",
        },
      ],
    },
    {
      title: "Passing ping test",
      fetchOptions: {},
      url: "http://localhost:8000/ping",
      asserts: [
        {
          comparison: "EQUAL",
          title: "status code is 200",
          propDrilldown: ["status_code"],
          type: "STATUS_CODE",
          value: 200,
        },
        {
          comparison: "EQUAL",
          title: "body has string here",
          propDrilldown: ["inner", "property", "insider"],
          type: "BODY",
          value: "here",
        },
      ],
    },
  ]);
};

runTests();

And the result from the code example

Alt text

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago