This repository was archived by the owner on Mar 28, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
16
16
17
17
## [ 1.4.0] - 2020-01-12
18
18
### Added
19
+ - Add display name
19
20
20
21
## [ 1.3.2] - 2020-01-12
21
22
### Changed
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const {
18
18
FIXTURES
19
19
} = require ( "@mocks-server/admin-api-paths" ) ;
20
20
21
+ const packageInfo = require ( "../package.json" ) ;
21
22
const DeprecatedApi = require ( "./deprecated/Api" ) ;
22
23
23
24
const Settings = require ( "./Settings" ) ;
@@ -59,6 +60,10 @@ class Plugin {
59
60
this . _onChangeSettings = this . _onChangeSettings . bind ( this ) ;
60
61
}
61
62
63
+ get displayName ( ) {
64
+ return packageInfo . name ;
65
+ }
66
+
62
67
async init ( ) {
63
68
await this . _deprecatedApi . init ( ) ;
64
69
this . _core . onChangeSettings ( this . _onChangeSettings ) ;
Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ describe("Plugin", () => {
61
61
deprecatedApiMock . restore ( ) ;
62
62
} ) ;
63
63
64
+ describe ( "display name" , ( ) => {
65
+ it ( "should return package name" , async ( ) => {
66
+ expect ( plugin . displayName ) . toEqual ( "@mocks-server/plugin-admin-api" ) ;
67
+ } ) ;
68
+ } ) ;
69
+
64
70
describe ( "when initializated" , ( ) => {
65
71
it ( "should create an express Router" , async ( ) => {
66
72
await plugin . init ( ) ;
You can’t perform that action at this time.
0 commit comments