mockaton 0.10.8 → 0.10.9

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/Tests.js CHANGED
@@ -179,6 +179,10 @@ async function test404() {
179
179
  const res = await request('/api/non-existing')
180
180
  equal(res.status, 404)
181
181
  })
182
+ await it('Sends 404 when there’s no mock at all for a method', async () => {
183
+ const res = await request('/api/non-existing-too', { method: 'DELETE' })
184
+ equal(res.status, 404)
185
+ })
182
186
  }
183
187
 
184
188
  async function testMockDispatching(url, file, expectedBody, reqBody = void 0) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mockaton",
3
3
  "description": "A deterministic server-side for developing and testing frontend clients",
4
4
  "type": "module",
5
- "version": "0.10.8",
5
+ "version": "0.10.9",
6
6
  "main": "index.js",
7
7
  "types": "index.d.ts",
8
8
  "license": "MIT",
@@ -61,7 +61,7 @@ export const getBrokerByFilename = file => {
61
61
  // BTW, `urlMasks` always start with "/", so there’s no need to
62
62
  // worry about the primacy of array-like keys when iterating.
63
63
  export function getBrokerForUrl(method, url) {
64
- if (!method in collection)
64
+ if (!collection[method])
65
65
  return
66
66
  const brokers = Object.values(collection[method])
67
67
  for (let i = brokers.length - 1; i >= 0; i--)