@qse/edu-scripts 1.13.9 → 1.13.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -27,14 +27,13 @@ var setupMock = debounce(function setupMock2() {
|
|
|
27
27
|
console.error(chalk.red(`Mock file ${file} error: ${e.message}`));
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
console.log("🚀 ~ file: index.js:47 ~ setupMock ~ mockCache:", mockCache);
|
|
31
30
|
}, 100);
|
|
32
31
|
function mockMiddlewave(req, res, next) {
|
|
33
32
|
const { method, path } = req;
|
|
34
33
|
const key = `${method.toUpperCase()} ${path}`;
|
|
35
34
|
const mock = mockCache[key];
|
|
36
|
-
console.log(chalk.green(`Mock: ${key}`));
|
|
37
35
|
if (mock) {
|
|
36
|
+
console.log(chalk.green(`Mock: ${key}`));
|
|
38
37
|
if (typeof mock === "function") {
|
|
39
38
|
mock(req, res, next);
|
|
40
39
|
} else {
|
package/package.json
CHANGED
|
@@ -35,7 +35,6 @@ const setupMock = debounce(function setupMock() {
|
|
|
35
35
|
console.error(chalk.red(`Mock file ${file} error: ${e.message}`))
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
console.log('🚀 ~ file: index.js:47 ~ setupMock ~ mockCache:', mockCache)
|
|
39
38
|
}, 100)
|
|
40
39
|
|
|
41
40
|
/**
|
|
@@ -45,8 +44,8 @@ function mockMiddlewave(req, res, next) {
|
|
|
45
44
|
const { method, path } = req
|
|
46
45
|
const key = `${method.toUpperCase()} ${path}`
|
|
47
46
|
const mock = mockCache[key]
|
|
48
|
-
console.log(chalk.green(`Mock: ${key}`))
|
|
49
47
|
if (mock) {
|
|
48
|
+
console.log(chalk.green(`Mock: ${key}`))
|
|
50
49
|
if (typeof mock === 'function') {
|
|
51
50
|
mock(req, res, next)
|
|
52
51
|
} else {
|