• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

chimurai / http-proxy-middleware / 8860409150

27 Apr 2024 02:09PM UTC coverage: 97.644%. Remained the same
8860409150

Pull #994

github

web-flow
Merge 2ae5ed0fb into f424cefc6
Pull Request #994: docs(examples): move example dependencies from root

128 of 133 branches covered (96.24%)

373 of 382 relevant lines covered (97.64%)

24.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/get-plugins.ts
1
import type { Options, Plugin } from './types';
2
import {
12✔
3
  debugProxyErrorsPlugin,
4
  loggerPlugin,
5
  errorResponsePlugin,
6
  proxyEventsPlugin,
7
} from './plugins/default';
8

9
export function getPlugins<TReq, TRes>(options: Options<TReq, TRes>): Plugin<TReq, TRes>[] {
12✔
10
  // don't load default errorResponsePlugin if user has specified their own
11
  const maybeErrorResponsePlugin = !!options.on?.error ? [] : [errorResponsePlugin];
77✔
12

13
  const defaultPlugins = !!options.ejectPlugins
77✔
14
    ? [] // no default plugins when ejecting
15
    : [debugProxyErrorsPlugin, proxyEventsPlugin, loggerPlugin, ...maybeErrorResponsePlugin];
16
  const userPlugins: Plugin<TReq, TRes>[] = options.plugins ?? [];
77✔
17
  return [...defaultPlugins, ...userPlugins] as unknown as Plugin<TReq, TRes>[];
77✔
18
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc