Skip to content

Commit

Permalink
fix(cli): clean up template for life cycle observers
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondfeng committed May 23, 2019
1 parent 47f2b93 commit 6733610
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
@@ -1,7 +1,6 @@
import {
/* inject, Application, CoreBindings, */
lifeCycleObserver, // The decorator
CoreTags,
LifeCycleObserver, // The interface
} from '@loopback/core';

Expand All @@ -28,6 +27,6 @@ export class <%= className %> implements LifeCycleObserver {
* This method will be invoked when the application stops
*/
async stop(): Promise<void> {
// Add your logic for start
// Add your logic for stop
}
}
Expand Up @@ -81,6 +81,8 @@ function verifyGeneratedScript(group = '') {
);
assert.fileContent(expectedFile, `@lifeCycleObserver('${group}')`);
assert.fileContent(expectedFile, /async start\(\): Promise\<void\> {/);
assert.fileContent(expectedFile, /\/\/ Add your logic for start/);
assert.fileContent(expectedFile, /\/\/ Add your logic for stop/);
assert.fileContent(expectedFile, /async stop\(\): Promise\<void\> {/);
assert.file(INDEX_FILE);
assert.fileContent(INDEX_FILE, /export \* from '.\/my-observer.observer';/);
Expand Down

0 comments on commit 6733610

Please sign in to comment.