Skip to content

Commit a50005d

Browse files
committed
Fixed the issue where printStartupLog and noHandlerResponse404 were set to false and did not work
1 parent 2abb03d commit a50005d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ export default (options?: MockOptions): Plugin => {
6666
options.mockRootDir = options.mockRootDir || './mock'
6767
options.mockJsSuffix = options.mockJsSuffix || '.mock.js'
6868
options.mockTsSuffix = options.mockTsSuffix || '.mock.ts'
69-
options.noHandlerResponse404 = options.noHandlerResponse404 || true
70-
options.printStartupLog = options.printStartupLog || true
69+
console.log(typeof options.printStartupLog)
70+
options.noHandlerResponse404 = (typeof options.noHandlerResponse404 !== 'boolean') ? true : options.noHandlerResponse404
71+
options.printStartupLog = (typeof options.printStartupLog !== 'boolean') ? true : options.printStartupLog
7172
if (options.mockModules && options.mockModules.length > 0) {
7273
console.warn('[' + PLUGIN_NAME + '] mock modules will be set automatically, and the configuration will be ignored', options.mockModules)
7374
}

0 commit comments

Comments
 (0)