Skip to content

Commit

Permalink
feat(stubs): generate an empty class when creating a service
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Nov 25, 2024
1 parent 41f5d66 commit bf9b2bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions stubs/make/service/main.stub
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{#var serviceName = string(entity.name).pascalCase().suffix('Service')}}
{{#var serviceFileName = generators.serviceFileName(entity.name)}}
{{{
exports({
to: app.servicesPath(entity.path, serviceFileName)
})
}}}
export class {{ serviceName }} {
// Your code here
}
2 changes: 1 addition & 1 deletion tests/stubs/make_service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ test.group('Make Service', () => {
})

assert.equal(destination, join(BASE_PATH, 'app/services/app_service.ts'))
assert.equal(contents.trim(), '')
assert.match(contents.trim(), /export class AppService {/)
})
})

0 comments on commit bf9b2bd

Please sign in to comment.