mockaton 6.4.0 → 6.4.1

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
@@ -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": "6.4.0",
5
+ "version": "6.4.1",
6
6
  "main": "index.js",
7
7
  "types": "index.d.ts",
8
8
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  {
2
- "_": "This file has a comment: `(entirely unverified)`. i.e. the route is /api/user/videos",
2
+ "_": "This file has a comment: `(default)`. Which makes the file with comment: (all variants) not to win",
3
3
  "videos": [
4
4
  {
5
5
  "url": "https://example.com/1",
package/src/MockBroker.js CHANGED
@@ -41,7 +41,13 @@ export class MockBroker {
41
41
  get status() { return parseFilename(this.file).status }
42
42
 
43
43
  selectDefaultFile() {
44
- this.updateFile(this.#findMockWithDefaultComment() || this.mocks[0])
44
+ const userSpecifiedDefault = this.#findMockWithDefaultComment()
45
+ if (userSpecifiedDefault)
46
+ this.mocks = [ // sort for dashboard list TESTME
47
+ userSpecifiedDefault,
48
+ ...this.mocks.filter(m => m !== userSpecifiedDefault)
49
+ ]
50
+ this.updateFile(userSpecifiedDefault || this.mocks[0])
45
51
  }
46
52
  #findMockWithDefaultComment() {
47
53
  for (const f of this.mocks)