MCPcopy Index your code
hub / github.com/eggjs/egg / formatOptions

Function formatOptions

test/utils.ts:138–158  ·  view source on GitHub ↗
(name: string | MockOptions, options?: MockOptions)

Source from the content-addressed store, hash-verified

136}
137
138function formatOptions(name: string | MockOptions, options?: MockOptions) {
139 let baseDir;
140 if (typeof name === 'string') {
141 baseDir = name;
142 } else {
143 // name is options
144 options = name;
145 baseDir = options.baseDir!;
146 }
147 if (!baseDir.startsWith('/')) {
148 baseDir = path.join(__dirname, 'fixtures', baseDir);
149 }
150 return {
151 baseDir,
152 framework: eggPath,
153 cache: false,
154 // change default mockCtxStorage to false because we don't need it in framework test
155 mockCtxStorage: false,
156 ...options,
157 };
158}

Callers 2

appFunction · 0.85
clusterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…