mockaton 13.9.9 → 13.9.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/package.json
CHANGED
package/src/client/app.css
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
--colorBgField: light-dark(#fcfcfc, #2c2c2c);
|
|
5
5
|
--colorBgFieldHover: light-dark(#fff, #171717);
|
|
6
6
|
|
|
7
|
-
--colorBgHeader: light-dark(#
|
|
8
|
-
--colorBgHeaderField: light-dark(#
|
|
7
|
+
--colorBgHeader: light-dark(#ededef, #141414);
|
|
8
|
+
--colorBgHeaderField: light-dark(#fbfbfb, #222);
|
|
9
9
|
|
|
10
10
|
--colorBorder: light-dark(#e0e0e0, #2c2c2c);
|
|
11
11
|
--colorBorderActive: light-dark(#c8c8c8, #3c3c3c);
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
--shadowRim: light-dark(#fff, #333);
|
|
30
30
|
--shadowDrop: light-dark(rgba(0, 0, 0, 0.2), #000);
|
|
31
|
-
--boxShadowRimDrop: inset 0 0 1px
|
|
31
|
+
--boxShadowRimDrop: inset 0 0 1px 0.5px var(--shadowRim), 0 1px 2px var(--shadowDrop);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
html,
|
|
@@ -287,7 +287,7 @@ header {
|
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
span {
|
|
290
|
-
margin-left:
|
|
290
|
+
margin-left: 8px;
|
|
291
291
|
}
|
|
292
292
|
input {
|
|
293
293
|
border-bottom-left-radius: 0;
|
|
@@ -12,17 +12,19 @@ test('dittoSplitPaths', () => {
|
|
|
12
12
|
'/api/video/id',
|
|
13
13
|
'/api/video/stats',
|
|
14
14
|
'/v2/foo',
|
|
15
|
-
'/v2/foo/bar'
|
|
15
|
+
'/v2/foo/bar',
|
|
16
|
+
'/v2/foo/bar' // paths can be repeated
|
|
16
17
|
]
|
|
17
18
|
deepEqual(dittoSplitPaths(input), [
|
|
18
19
|
['', '/api/user'],
|
|
19
|
-
['/api/user
|
|
20
|
-
['/api/user
|
|
21
|
-
['/api
|
|
22
|
-
['/api
|
|
23
|
-
['/api/video
|
|
20
|
+
['/api/user', '/avatar'],
|
|
21
|
+
['/api/user', '/friends'],
|
|
22
|
+
['/api', '/vid'],
|
|
23
|
+
['/api', '/video/id'],
|
|
24
|
+
['/api/video', '/stats'],
|
|
24
25
|
['', '/v2/foo'],
|
|
25
|
-
['/v2/foo
|
|
26
|
+
['/v2/foo', '/bar'],
|
|
27
|
+
['/v2/foo/bar', ''],
|
|
26
28
|
])
|
|
27
29
|
})
|
|
28
30
|
|
package/src/server/MockBroker.js
CHANGED
|
@@ -10,7 +10,7 @@ import { removeQueryStringAndFragment } from './utils/HttpIncomingMessage.js'
|
|
|
10
10
|
export class MockBroker {
|
|
11
11
|
file = '' // selected mock filename
|
|
12
12
|
mocks = [] // filenames
|
|
13
|
-
isStatic = false // doesn’t follow filename convention
|
|
13
|
+
isStatic = false // static means it doesn’t follow filename convention
|
|
14
14
|
delayed = false
|
|
15
15
|
proxied = false
|
|
16
16
|
status = -1
|
package/src/server/cli.test.js
CHANGED
|
@@ -72,7 +72,7 @@ export function unregisterMock(file) {
|
|
|
72
72
|
function filesInDir(dir) {
|
|
73
73
|
const files = []
|
|
74
74
|
forEachBroker(b => {
|
|
75
|
-
files.push(...
|
|
75
|
+
files.push(...b.mocks.filter(m => m.startsWith(dir + '/')))
|
|
76
76
|
})
|
|
77
77
|
return files
|
|
78
78
|
}
|
|
@@ -98,7 +98,9 @@ export function brokerByRoute(method, url) {
|
|
|
98
98
|
|
|
99
99
|
// TODO Verify
|
|
100
100
|
if (method === 'GET') {
|
|
101
|
-
const indexUrl = url.endsWith('/')
|
|
101
|
+
const indexUrl = url.endsWith('/')
|
|
102
|
+
? url + 'index.html'
|
|
103
|
+
: url + '/index.html'
|
|
102
104
|
for (let i = brokers.length - 1; i >= 0; i--)
|
|
103
105
|
if (brokers[i].urlMaskMatches(indexUrl))
|
|
104
106
|
return brokers[i]
|