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/).
1616
1717## [ 1.4.0] - 2020-01-12
1818### Added
19+ - Add display name
1920
2021## [ 1.3.2] - 2020-01-12
2122### Changed
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const {
1818 FIXTURES
1919} = require ( "@mocks-server/admin-api-paths" ) ;
2020
21+ const packageInfo = require ( "../package.json" ) ;
2122const DeprecatedApi = require ( "./deprecated/Api" ) ;
2223
2324const 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 ) ;
Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments