mockaton 9.3.0 → 9.4.0

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
@@ -15,22 +15,25 @@ An HTTP mock server for simulating APIs with minimal setup
15
15
  ## Motivation
16
16
 
17
17
  **No API state should be too hard to test.**
18
- With Mockaton, developers can achieve correctness without sacrificing speed.
18
+ With Mockaton, developers can achieve correctness and increase speed.
19
19
 
20
20
  ### Correctness
21
- - Enables testing of complex scenarios that would otherwise be
22
- skipped. For example, triggering an error on a third-party API. Or if
23
- you are a frontend developer, triggering it on your project’s backend.
24
- - Allows for deterministic, comprehensive, and consistent state, which helps
25
- spot inadvertent regressions during development, or for setting up screenshot
26
- tests, e.g., with [pixaton](https://github.com/ericfortis/pixaton).
21
+ - Enables testing of complex scenarios that would otherwise be skipped. e.g.,
22
+ - Triggering errors on third-party APIs.
23
+ - Triggering errors on your project’s backend (if you are a frontend developer).
24
+ - Allows for deterministic, comprehensive, and consistent state.
25
+ - Spot inadvertent regressions during development.
26
+ - Use it to set up screenshot tests, e.g., with [pixaton](https://github.com/ericfortis/pixaton).
27
27
 
28
28
  ### Speed
29
- - Prevents progress from being blocked by waiting for APIs.
30
29
  - Works around unstable dev backends while developing UIs.
31
- - Time travel. If you commit the mocks to your repo, it’s straightforward
32
- to check out long-lived branches and bisect bugs, so you don’t
33
- have to downgrade backends to old API contracts or databases.
30
+ - Spinning up development infrastructure.
31
+ - Syncing database states.
32
+ - Prevents progress from being blocked by waiting for APIs.
33
+ - Time travel. If you commit the mocks to your repo,
34
+ you don’t have to downgrade backends for:
35
+ - checking out long-lived branches
36
+ - bisecting bugs
34
37
 
35
38
  <br/>
36
39
 
@@ -125,6 +128,7 @@ They will be saved in your `config.mocksDir` following the filename convention.
125
128
  - Does not hijack your HTTP client.
126
129
  - Auditable. Organized and small &mdash; under 4 KLoC (half is UI and tests).
127
130
 
131
+ <br/>
128
132
 
129
133
  ## Basic Usage
130
134
  1. Install Node.js, which comes with `npm` and `npx`
@@ -141,18 +145,18 @@ npx mockaton --port 2345
141
145
 
142
146
  4. Test it
143
147
  ```shell
144
- curl http://localhost:2345/api/foo
148
+ curl localhost:2345/api/foo
145
149
  ```
146
150
 
147
151
  ### Alternative Installations
148
152
  <details>
149
- <summary>With NPM…</summary>
153
+ <summary>With NPM (package.json)…</summary>
150
154
 
151
155
  ```shell
152
156
  npm install mockaton --save-dev
153
157
  ```
154
158
 
155
- Then in your, `package.json`:
159
+ Then, add the script to your `package.json`:
156
160
  ```json
157
161
  {
158
162
  "scripts": {
@@ -248,7 +252,7 @@ export default defineConfig({
248
252
  ```
249
253
 
250
254
  <details>
251
- <summary><b>See Config Documentation</b></summary>
255
+ <summary><b>Config Documentation</b></summary>
252
256
 
253
257
  ### `mocksDir?: string`
254
258
  Defaults to `'mockaton-mocks'`.
@@ -502,7 +506,7 @@ const server = Mockaton({
502
506
  ...mockatonConfig, // Not required, but it’s not read by default.
503
507
  })
504
508
  ```
505
- See [src/cli.js](src/cli.js)
509
+ See [src/cli.js](src/cli.js) or [src/Mockaton.test.js](src/Mockaton.test.js) for more examples.
506
510
 
507
511
  </details>
508
512