Socket
Socket
Sign inDemoInstall

arrow-express

Package Overview
Dependencies
71
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.0 to 2.1.1

22

lib/application/application.spec.ts

@@ -203,4 +203,6 @@ import Express from "express";

it("should pass context through controllers chain", async () => {
const rootSpy = jest.fn().mockResolvedValue("root") as ControllerHandler<any>;
const spy = jest.fn().mockImplementation((_, __, context) => context + "-child") as ControllerHandler<any>;
const rootSpy = jest.fn().mockResolvedValue("root-context") as ControllerHandler<any>;
const spy = jest
.fn()
.mockImplementation((_, __, context) => context + "-child-context") as ControllerHandler<any>;
const routeSpy = jest.fn();

@@ -215,5 +217,19 @@ Application({ app: ExpressAppStub, logRequests: false })

await mocked(ExpressAppStub.get).mock.calls[0][1]({} as never, resSpy);
expect(routeSpy).toHaveBeenCalledWith(expect.anything(), expect.anything(), "root-child");
expect(routeSpy).toHaveBeenCalledWith(expect.anything(), expect.anything(), "root-context-child-context");
});
it("should pass context through controllers chain if child controllers doesn't have context", async () => {
const rootSpy = jest.fn().mockResolvedValue("root-context") as ControllerHandler<any>;
const routeSpy = jest.fn();
Application({ app: ExpressAppStub, logRequests: false })
.registerController(
Controller()
.handler(rootSpy)
.registerController(Controller().registerRoute(Route().method("get").handler(routeSpy)))
)
.configure(false);
await mocked(ExpressAppStub.get).mock.calls[0][1]({} as never, resSpy);
expect(routeSpy).toHaveBeenCalledWith(expect.anything(), expect.anything(), "root-context");
});
it("should call controller handler", async () => {

@@ -220,0 +236,0 @@ const spy = jest.fn().mockRejectedValue(new Error()) as ControllerHandler<any>;

2

package.json
{
"name": "arrow-express",
"version": "2.1.0",
"version": "2.1.1",
"description": "Library to bootstrap express applications with zero configuration",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc