mockaton 8.20.2 → 8.20.4

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/README.md CHANGED
@@ -5,9 +5,8 @@
5
5
  [![Test](https://github.com/ericfortis/mockaton/actions/workflows/test.yml/badge.svg)](https://github.com/ericfortis/mockaton/actions/workflows/test.yml)
6
6
  [![CodeQL](https://github.com/ericfortis/mockaton/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/ericfortis/mockaton/actions/workflows/github-code-scanning/codeql)
7
7
 
8
- An HTTP mock server for simulating APIs with minimal setup — ideal for testing
9
- difficult to reproduce states. For example, triggering an error on a third-party API.
10
- Similarly, if you are a frontend developer, triggering it on your project’s backend.
8
+ An HTTP mock server for simulating APIs with minimal setup
9
+ — ideal for testing difficult to reproduce states.
11
10
 
12
11
  <br/>
13
12
 
@@ -17,7 +16,9 @@ Similarly, if you are a frontend developer, triggering it on your project’s ba
17
16
  With Mockaton, developers can achieve correctness without sacrificing speed.
18
17
 
19
18
  ### Correctness
20
- - Enables testing of complex or rare scenarios that would otherwise be skipped.
19
+ - Enables testing of complex scenarios that would otherwise be
20
+ skipped. For example, triggering an error on a third-party API. Or if
21
+ you are a frontend developer, triggering it on your project’s backend.
21
22
  - Allows for deterministic, comprehensive, and consistent state.
22
23
 
23
24
  ### Speed
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "mockaton",
3
3
  "description": "HTTP Mock Server",
4
4
  "type": "module",
5
- "version": "8.20.2",
5
+ "version": "8.20.4",
6
6
  "main": "index.js",
7
7
  "types": "index.d.ts",
8
8
  "license": "MIT",
@@ -27,6 +27,6 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "pixaton": "1.1.2",
30
- "puppeteer": "24.17.0"
30
+ "puppeteer": "24.18.0"
31
31
  }
32
32
  }
package/src/Api.js CHANGED
@@ -60,7 +60,7 @@ function serveDashboard(_, response) {
60
60
  }
61
61
 
62
62
  function serveDashboardAsset(f) {
63
- return (req, response) =>
63
+ return (_, response) =>
64
64
  sendFile(response, join(import.meta.dirname, f))
65
65
  }
66
66
 
package/src/Dashboard.css CHANGED
@@ -165,6 +165,7 @@ header {
165
165
  border: 0;
166
166
  border-right: 3px solid transparent;
167
167
  margin-top: 4px;
168
+ outline: 1px solid var(--colorSecondaryActionBorder);
168
169
  color: var(--colorText);
169
170
  font-size: 11px;
170
171
  background-color: var(--colorComboBoxHeaderBackground);
@@ -252,7 +253,7 @@ header {
252
253
  main {
253
254
  display: grid;
254
255
  min-height: 0;
255
- grid-template-columns: min(820px) 1fr;
256
+ grid-template-columns: minmax(min-content, max-content) 1fr;
256
257
 
257
258
  @media (max-width: 1160px) {
258
259
  grid-template-columns: min(620px) 1fr;
@@ -322,13 +323,11 @@ table {
322
323
  .MockSelector {
323
324
  width: 100%;
324
325
  height: 26px;
325
- padding-right: 5px;
326
- padding-left: 16px;
327
- text-align: right;
328
- direction: rtl;
326
+ padding-right: 8px;
327
+ padding-left: 8px;
329
328
  text-overflow: ellipsis;
330
329
  font-size: 12px;
331
- background-position: 2px center;
330
+ background-position: calc(100% - 4px) center;
332
331
 
333
332
  &.nonDefault {
334
333
  font-weight: bold;
@@ -519,6 +518,7 @@ table {
519
518
 
520
519
  .ProgressBar {
521
520
  position: relative;
521
+ top: -4px;
522
522
  width: 100%;
523
523
  height: 2px;
524
524
  background: var(--colorComboBoxHeaderBackground);
package/src/Dashboard.js CHANGED
@@ -597,8 +597,8 @@ async function previewMock(method, urlMask, href) {
597
597
  previewMock.controller?.abort()
598
598
  previewMock.controller = new AbortController
599
599
 
600
- renderProgressBar()
601
600
  payloadViewerTitleRef.current.replaceChildren(r('span', null, Strings.fetching))
601
+ payloadViewerRef.current.replaceChildren(PayloadViewerProgressBar())
602
602
 
603
603
  try {
604
604
  const response = await fetch(href, {
@@ -607,10 +607,9 @@ async function previewMock(method, urlMask, href) {
607
607
  })
608
608
  await updatePayloadViewer(method, urlMask, response)
609
609
  }
610
- catch {}
611
-
612
- function renderProgressBar() {
613
- payloadViewerRef.current.replaceChildren(PayloadViewerProgressBar())
610
+ catch (err) {
611
+ onError(err)
612
+ payloadViewerRef.current.replaceChildren()
614
613
  }
615
614
  }
616
615
 
@@ -755,7 +754,9 @@ async function poll() {
755
754
  /** # Utils */
756
755
 
757
756
  function className(...args) {
758
- return { className: args.filter(Boolean).join(' ') }
757
+ return {
758
+ className: args.filter(Boolean).join(' ')
759
+ }
759
760
  }
760
761
 
761
762
 
@@ -3,7 +3,7 @@ import { listFilesRecursively } from './utils/fs.js'
3
3
  import { config, isFileAllowed } from './config.js'
4
4
 
5
5
 
6
- export class StaticBroker {
6
+ class StaticBroker {
7
7
  constructor(route) {
8
8
  this.route = route
9
9
  this.delayed = false