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

Commit c44d89c

Browse files
committed
feat(#10): Add display name
1 parent bd0af90 commit c44d89c

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

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

1717
## [1.4.0] - 2020-01-12
1818
### Added
19+
- Add display name
1920

2021
## [1.3.2] - 2020-01-12
2122
### Changed

src/Plugin.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const {
1818
FIXTURES
1919
} = require("@mocks-server/admin-api-paths");
2020

21+
const packageInfo = require("../package.json");
2122
const DeprecatedApi = require("./deprecated/Api");
2223

2324
const Settings = require("./Settings");
@@ -59,6 +60,10 @@ class Plugin {
5960
this._onChangeSettings = this._onChangeSettings.bind(this);
6061
}
6162

63+
get displayName() {
64+
return packageInfo.name;
65+
}
66+
6267
async init() {
6368
await this._deprecatedApi.init();
6469
this._core.onChangeSettings(this._onChangeSettings);

test/unit/src/Plugin.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ describe("Plugin", () => {
6161
deprecatedApiMock.restore();
6262
});
6363

64+
describe("display name", () => {
65+
it("should return package name", async () => {
66+
expect(plugin.displayName).toEqual("@mocks-server/plugin-admin-api");
67+
});
68+
});
69+
6470
describe("when initializated", () => {
6571
it("should create an express Router", async () => {
6672
await plugin.init();

0 commit comments

Comments
 (0)