Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
teardown(emitter) {
if (!this.isActive) {
return Promise.resolve();
}
const token = this.container.get('token', '');
const dev = this.container.get('dev', false);
const actionable = this.container.get('actionable', true);
const options = {
dev, json: true,
'show-vulnerable-paths': actionable ? 'true' : 'false',
};
snykUserConfig.set('api', token);
return Promise.all(
this._modules.map(args => {
const [ npmModule, emitModule ] = args;
return snykTest(npmModule.rootDir, options)
.then(result => this._createReport(npmModule, emitModule, result, options))
.catch(error => this._createReport(npmModule, emitModule, error, options))
})
);
}