Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
/* eslint-disable global-require */
SlackClient = require('messaging-api-slack').SlackOAuthClient;
SlackContext = require('../SlackContext').default;
SlackEvent = require('../SlackEvent').default;
sleep = require('delay');
warning = require('warning');
/* eslint-enable global-require */
});
constructor(options: ConstructorOptions) {
const { verificationToken, skipLegacyProfile } = options;
if ('client' in options) {
this._client = options.client;
} else {
const { accessToken, origin } = options;
this._client = SlackOAuthClient.connect({
accessToken,
origin,
});
}
this._verificationToken = verificationToken || '';
this._skipLegacyProfile =
typeof skipLegacyProfile === 'boolean' ? skipLegacyProfile : true;
if (!this._verificationToken) {
warning(
false,
'`verificationToken` is not set. Will bypass Slack event verification.\nPass in `verificationToken` to perform Slack event verification.'
);
}