New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

remix-testing-utils

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remix-testing-utils

A set of utility functions and types to make testing in Remix easier

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Remix Testing Utils NPM version CI License: MIT

This package contains simple utility functions to test with Remix.run.

Installation

npm install --save-dev remix-testing-utils

API Reference

createLoaderRequest

This createLoaderRequest function is used to create a dummy instance of the request needed when testing the loader function.

const req = createLoaderRequest("http://localhost:3000/", {
    cookie: "__session=helloworld"
  });
await loader({
  request: req,
  context: {},
  params: {},
})

createActionRequest

This createActionRequest function is used to generate a dummy instance of the request needed when testing the action function.

const req = createActionRequest("http://localhost:3000/", {
    id: "user-id",
    name: "user-name",
  });
await action({
  request: req,
  context: {},
  params: {},
});

createStripeWebhookRequest

This createsStripeWebhookRequest function is not directly related to Remix, but is used to create a dummy of the request instance needed when testing the Stripe webhook implemented by the action function.

const request = createStripeWebhookRequest(
  "http://localhost:3000/api/webhook/stripe",
  "stripe-signature",
  customerSubscriptionUpdatedEventPayload
);
await action({
  request,
  context: {},
  params: {},
});

Author

License

  • MIT License

Keywords

FAQs

Package last updated on 17 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc