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

Commit

Permalink
Merge pull request #96 from mocks-server/release
Browse files Browse the repository at this point in the history
Release v2.1.0
  • Loading branch information
javierbrea authored Dec 26, 2020
2 parents a8f692d + 55e4d68 commit e21cdbc
Show file tree
Hide file tree
Showing 16 changed files with 297 additions and 255 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
### Removed

## [2.1.0] - 2020-12-26

### Added
- feat: Add method for reading alerts (#94)

### Changed
- chore(lint): Lint mocks folder
- test(refactor): Move helpers to a support folder

### Fixed
- fix: Remove mocks-server-plugin tag from package.json (#93)

## [2.0.5] - 2020-12-21

### Added
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

# Mocks-server administration api client

This package contains methods for administrating the mocks-server _(through the [@mocks-server/plugin-admin-api](https://github.com/mocks-server/plugin-admin-api) REST API)_.
This package contains methods for administrating `mocks-server` _(through the [@mocks-server/plugin-admin-api](https://github.com/mocks-server/plugin-admin-api) REST API)_.

Requests to the @mocks-server are made using [cross-fetch](https://www.npmjs.com/package/cross-fetch), which makes this package compatible with browsers and nodejs environments, but, if you are going to build a browser application, you'll probably prefer to use the [@mocks-server/admin-api-client-data-provider package](https://www.npmjs.com/package/@mocks-server/admin-api-client-data-provider), which uses [@data-provider](https://github.com/data-provider), and works well with Redux, React, etc.
Requests to `mocks-server` are made using [cross-fetch](https://www.npmjs.com/package/cross-fetch), which makes this package compatible with browsers and nodejs environments, but, if you are going to build a browser application, you'll probably prefer to use the [@mocks-server/admin-api-client-data-provider package](https://www.npmjs.com/package/@mocks-server/admin-api-client-data-provider), which uses [@data-provider](https://github.com/data-provider), and works well with Redux, React, etc.

## Install

Expand All @@ -24,7 +24,7 @@ The UMD build is also available on unpkg:
<script src="https://unpkg.com/@mocks-server/admin-api-client/dist/index.umd.js"></script>
```

> The umd distribution is bundled with the "cross-env" dependency, but requires the "@mocks-server/admin-api-paths" dependency to be added separately.
> The umd distribution is bundled with the `cross-env` dependency, but requires the `@mocks-server/admin-api-paths` dependency to be added separately.
## Usage

Expand Down Expand Up @@ -59,6 +59,8 @@ example();
* `behavior(behaviorName).read()` - Returns an specific behavior.
* `fixtures.read()` - Returns collection of available fixtures.
* `fixture(fixtureId).read()` - Returns an specific fixture.
* `alerts.read()` - Returns array of current alerts.
* `alert(alertId).read()` - Returns an specific alert.

## Configuration

Expand Down
5 changes: 1 addition & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ module.exports = {
},

// The glob patterns Jest uses to detect test files
testMatch: [
"<rootDir>/test/?(*.)+(spec|test).js?(x)",
"<rootDir>/test/*/?(*.)+(spec|test).js?(x)",
],
testMatch: ["<rootDir>/test/*.spec.js"],

transform: {
".js$": "babel-jest",
Expand Down
5 changes: 3 additions & 2 deletions mocks/mocks-server.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
options: {
port: 3200
}
port: 3200,
log: "debug",
},
};
2 changes: 2 additions & 0 deletions mocks/mocks-with-error/fixtures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//eslint-disable-next-line
module.exports = FOO
2 changes: 1 addition & 1 deletion mocks/mocks/behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ const user2 = new Behavior([getUser2]);

module.exports = {
base,
user2
user2,
};
10 changes: 5 additions & 5 deletions mocks/mocks/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ const getUser = {
method: "GET",
response: {
status: 200,
body: [{ email: "[email protected]" }]
}
body: [{ email: "[email protected]" }],
},
};

const getUser2 = {
url: "/api/user",
method: "GET",
response: {
status: 200,
body: [{ email: "[email protected]" }]
}
body: [{ email: "[email protected]" }],
},
};

module.exports = {
getUser,
getUser2
getUser2,
};
Loading

0 comments on commit e21cdbc

Please sign in to comment.