Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf9b2bd

Browse files
committed
feat(stubs): generate an empty class when creating a service
1 parent 41f5d66 commit bf9b2bd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

stubs/make/service/main.stub

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
{{#var serviceName = string(entity.name).pascalCase().suffix('Service')}}
12
{{#var serviceFileName = generators.serviceFileName(entity.name)}}
23
{{{
34
exports({
45
to: app.servicesPath(entity.path, serviceFileName)
56
})
67
}}}
8+
export class {{ serviceName }} {
9+
// Your code here
10+
}

tests/stubs/make_service.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ test.group('Make Service', () => {
3131
})
3232

3333
assert.equal(destination, join(BASE_PATH, 'app/services/app_service.ts'))
34-
assert.equal(contents.trim(), '')
34+
assert.match(contents.trim(), /export class AppService {/)
3535
})
3636
})

0 commit comments

Comments
 (0)