Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export default class StackOutputPlugin {
private options: Serverless.Options
) {
this.hooks = {
'after:deploy:deploy': this.process.bind(this)
'after:deploy:deploy': this.process.bind(this),
'after:info:info': this.process.bind(this)
}

this.output = this.serverless.service.custom.output
Expand Down
27 changes: 27 additions & 0 deletions test/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,31 @@ describe('Plugin', () => {
expect(test.file).toContain('foo/bar.toml')
})
})

describe('Plugin attached to hooks', () => {
it('attached to after deploy and info hook', () => {
const config = {
cli: { log: () => null },
config: {
servicePath: ''
},
getProvider,
region: 'us-east-1',
service: {
custom: {
output: {
file: 'foo/bar.toml'
}
},
provider: {
name: 'aws'
}
}
}
const test = new Plugin(config)

expect(test.hooks).toHaveProperty('after:deploy:deploy')
expect(test.hooks).toHaveProperty('after:info:info')
})
})
})