MCPcopy Index your code
hub / github.com/angular/angular / modifyArguments

Function modifyArguments

packages/zone.js/lib/mocha/mocha.ts:54–73  ·  view source on GitHub ↗
(args: IArguments, syncTest: Function, asyncTest?: Function)

Source from the content-addressed store, hash-verified

52 };
53
54 function modifyArguments(args: IArguments, syncTest: Function, asyncTest?: Function): any[] {
55 for (let i = 0; i < args.length; i++) {
56 let arg = args[i];
57 if (typeof arg === 'function') {
58 // The `done` callback is only passed through if the function expects at
59 // least one argument.
60 // Note we have to make a function with correct number of arguments,
61 // otherwise mocha will
62 // think that all functions are sync or async.
63 args[i] = arg.length === 0 ? syncTest(arg) : asyncTest!(arg);
64 // Mocha uses toString to view the test body in the result list, make sure we return the
65 // correct function body
66 args[i].toString = function () {
67 return arg.toString();
68 };
69 }
70 }
71
72 return args as any;
73 }
74
75 function wrapDescribeInZone(args: IArguments): any[] {
76 const syncTest: any = function (fn: Function) {

Callers 3

wrapDescribeInZoneFunction · 0.85
wrapTestInZoneFunction · 0.85
wrapSuiteInZoneFunction · 0.85

Calls 2

syncTestFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…