Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Releases: mocks-server/core

Update dependencies

10 Apr 08:32
0d804bc
Compare
Choose a tag to compare

Changed

  • Update dependencies

Update dependencies

22 Mar 10:59
9fc8190
Compare
Choose a tag to compare

Changed

  • Update dependencies

Update dependencies

27 Jan 18:29
63e9916
Compare
Choose a tag to compare

Changed

  • Update dependencies

Fixed versioning

12 Jan 12:12
9cbae07
Compare
Choose a tag to compare

Changed

  • Use fixed versioning in dependencies

Update dependencies

11 Jan 19:21
1a13472
Compare
Choose a tag to compare

Changed

  • Update dependencies

Fix file name conflicts

11 Jan 18:57
6fb81d8
Compare
Choose a tag to compare

Fixed

  • Conflicts between files with same name and different extension

Configuration file

06 Jan 08:30
f92d091
Compare
Choose a tag to compare

Added

  • Add "addPlugins" configuration.
  • Add "disableCommandLineArguments" configuration.
  • Add "disableConfigFile" configuration.
  • Load configuration and options from file.
  • Options can also be passed to the Core Constructor, using the "options" key in the config object.

Json definitions

03 Jan 09:20
968ec9f
Compare
Choose a tag to compare

Added

  • Behaviors can now be defined in json format.
  • Add behavior "id" property, to be used instead of "name".
  • Accept new options object as second argument when defining behaviors programmatically. "id" can be provided as an option.
  • Add behaviors "currentId" and "ids" getters, to be used instead of "currentName" and "names"
  • Add stop method to plugins.
  • Pass new method "load" to plugins, which allows to load fixtures or behaviors definitions programmatically.
  • Add "restartServer" method, which should be used instead of "restart".
  • Accept "displayName" property in plugins, which improves traces.
  • Accept "id" property in fixtures.

Changed

  • Convert filesHandler into a plugin. Load it always internally.

Fixed

  • Plugins start method was not being called again when core "start" method was called.
  • Prevent exit process when there is an error loading files.

Custom Fixtures Handlers

22 Dec 11:16
442a913
Compare
Choose a tag to compare

Added

  • Add "fixtures" getter, returning all found fixtures in mocks folder, and inside behaviors.
  • Add "addFixturesHandler" method, which allows to use fixtures with custom formats and handle responses.
  • Add "id" property to fixtures, which will be unique for each different fixture.
  • Add "requestMatchId" property to fixtures, which should be the same for fixtures handling same requests.
  • Add "request" getter to fixtures, which returns an object describing which requests will handle.
  • Add "response" getter to fixtures, which returns an object describing how will be the sent response.
  • Add "addRouter" method. "addCustomRouter" is marked for deprecation.
  • Add "addSetting" method. "addCustomSetting" is marked for deprecation.
  • Add "all" getter to settings.
  • Add "extendedFrom" getter to behavior.
  • Add "removeRouter" method.
  • Add "settings.getValidOptionName" method.

Changed

  • Files handler now supports creating fixtures or behaviors at any folder level.
  • Files handler now supports files exporting a single behavior or fixture.
  • Changed "Behaviors" getters. Data now is not parsed, and returns directly fixtures collections, or, in the case of "all" getter, it returns and object containing behavior names as "keys", containing respective fixtures collections. (It is not considered as a breaking change, as it is an experimental interface yet, as it is indicated in the documentation)
  • Change settings automatically to first found behavior if no one is defined.
  • Improve start, init and stop server methods. Now support multiple concurrent calls.
  • tracer.set method "transport" argument now is passed as second argument. Default value is "console".
  • Change "boom" dependency. Now "@hapi/boom" is used.

Default mocks path

07 Dec 10:07
5d7e275
Compare
Choose a tag to compare

Changed

  • "behaviors" option renamed to "path". Old option still working due to backward compatibility.
  • "path" option has "mocks" value by default. The server will create path if it does not exist.

Fixed

  • Fix server started log. Was always printing localhost, without taking into account custom "host" option.