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

Commit e21cdbc

Browse files
authored
Merge pull request #96 from mocks-server/release
Release v2.1.0
2 parents a8f692d + 55e4d68 commit e21cdbc

16 files changed

+297
-255
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Fixed
1111
### Removed
1212

13+
## [2.1.0] - 2020-12-26
14+
15+
### Added
16+
- feat: Add method for reading alerts (#94)
17+
18+
### Changed
19+
- chore(lint): Lint mocks folder
20+
- test(refactor): Move helpers to a support folder
21+
22+
### Fixed
23+
- fix: Remove mocks-server-plugin tag from package.json (#93)
24+
1325
## [2.0.5] - 2020-12-21
1426

1527
### Added

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
# Mocks-server administration api client
99

10-
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)_.
10+
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)_.
1111

12-
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.
12+
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.
1313

1414
## Install
1515

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

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

@@ -59,6 +59,8 @@ example();
5959
* `behavior(behaviorName).read()` - Returns an specific behavior.
6060
* `fixtures.read()` - Returns collection of available fixtures.
6161
* `fixture(fixtureId).read()` - Returns an specific fixture.
62+
* `alerts.read()` - Returns array of current alerts.
63+
* `alert(alertId).read()` - Returns an specific alert.
6264

6365
## Configuration
6466

jest.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ module.exports = {
2525
},
2626

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

3330
transform: {
3431
".js$": "babel-jest",

mocks/mocks-server.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
options: {
3-
port: 3200
4-
}
3+
port: 3200,
4+
log: "debug",
5+
},
56
};

mocks/mocks-with-error/fixtures.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//eslint-disable-next-line
2+
module.exports = FOO

mocks/mocks/behaviors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ const user2 = new Behavior([getUser2]);
77

88
module.exports = {
99
base,
10-
user2
10+
user2,
1111
};

mocks/mocks/fixtures.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ const getUser = {
33
method: "GET",
44
response: {
55
status: 200,
6-
body: [{ email: "foo@foo.com" }]
7-
}
6+
body: [{ email: "foo@foo.com" }],
7+
},
88
};
99

1010
const getUser2 = {
1111
url: "/api/user",
1212
method: "GET",
1313
response: {
1414
status: 200,
15-
body: [{ email: "foo2@foo2.com" }]
16-
}
15+
body: [{ email: "foo2@foo2.com" }],
16+
},
1717
};
1818

1919
module.exports = {
2020
getUser,
21-
getUser2
21+
getUser2,
2222
};

0 commit comments

Comments
 (0)