Upgrade some deps: helmet, slack, amplitude and short-uuid (#12817)

* upgrade helmet to version 4

* deps(short-uuid): upgrade to version 4, closes #12573

* deps(slack): upgrade to version 4

* deps(slack): upgrade to version 5, closes #11442

* deps(amplitude): upgrade to latest version use api v2

* fix tests

* slack tests: return promise

* refactor slack setup for tests

* fix slack unit tests
This commit is contained in:
Matteo Pagliazzi
2020-11-30 20:03:04 +01:00
committed by GitHub
parent 7057797ed3
commit 6a658c45b5
7 changed files with 131 additions and 411 deletions
@@ -1,4 +1,4 @@
import { IncomingWebhook } from '@slack/client';
import { IncomingWebhook } from '@slack/webhook';
import nconf from 'nconf';
import { v4 as generateUUID } from 'uuid';
import {
@@ -133,7 +133,7 @@ describe('POST /chat', () => {
describe('shadow-mute user', () => {
beforeEach(() => {
sandbox.spy(email, 'sendTxn');
sandbox.stub(IncomingWebhook.prototype, 'send');
sandbox.stub(IncomingWebhook.prototype, 'send').returns(Promise.resolve());
});
afterEach(() => {
@@ -355,7 +355,7 @@ describe('POST /chat', () => {
context('banned slur', () => {
beforeEach(() => {
sandbox.spy(email, 'sendTxn');
sandbox.stub(IncomingWebhook.prototype, 'send');
sandbox.stub(IncomingWebhook.prototype, 'send').returns(Promise.resolve());
});
afterEach(() => {