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

Commit 8bcfa32

Browse files
committed
feat: Add method for reading alerts (#94)
1 parent 842bfd8 commit 8bcfa32

File tree

10 files changed

+264
-230
lines changed

10 files changed

+264
-230
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [unreleased]
88
### Added
9+
- feat: Add method for reading alerts (#94)
910
### Changed
1011
- chore(lint): Lint mocks folder
1112
### Fixed

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

mocks/mocks-server.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
options: {
33
port: 3200,
4+
log: "debug",
45
},
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+
FOO

0 commit comments

Comments
 (0)