Skip to content

Commit 6733610

Browse files
committed
fix(cli): clean up template for life cycle observers
1 parent 47f2b93 commit 6733610

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/cli/generators/observer/templates/observer-template.ts.ejs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
/* inject, Application, CoreBindings, */
33
lifeCycleObserver, // The decorator
4-
CoreTags,
54
LifeCycleObserver, // The interface
65
} from '@loopback/core';
76

@@ -28,6 +27,6 @@ export class <%= className %> implements LifeCycleObserver {
2827
* This method will be invoked when the application stops
2928
*/
3029
async stop(): Promise<void> {
31-
// Add your logic for start
30+
// Add your logic for stop
3231
}
3332
}

packages/cli/test/integration/generators/observer.integration.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ function verifyGeneratedScript(group = '') {
8181
);
8282
assert.fileContent(expectedFile, `@lifeCycleObserver('${group}')`);
8383
assert.fileContent(expectedFile, /async start\(\): Promise\<void\> {/);
84+
assert.fileContent(expectedFile, /\/\/ Add your logic for start/);
85+
assert.fileContent(expectedFile, /\/\/ Add your logic for stop/);
8486
assert.fileContent(expectedFile, /async stop\(\): Promise\<void\> {/);
8587
assert.file(INDEX_FILE);
8688
assert.fileContent(INDEX_FILE, /export \* from '.\/my-observer.observer';/);

0 commit comments

Comments
 (0)