Skip to content

Commit

Permalink
Fixing consistent type assertions lint rule.
Browse files Browse the repository at this point in the history
  • Loading branch information
filmaj committed Aug 9, 2021
1 parent 7c93afc commit 79ef148
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/WorkflowStep.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('WorkflowStep', () => {
const { validate } = await importWorkflowStep();

// intentionally casting to string to trigger failure
const badId = {} as string;
const badId: string = {};
const validationFn = () => validate(badId, MOCK_CONFIG_SINGLE);

const expectedMsg = 'WorkflowStep expects a callback_id as the first argument';
Expand Down
24 changes: 12 additions & 12 deletions src/receivers/ExpressReceiver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,14 @@ describe('ExpressReceiver', function () {
it('should handle valid requests', async () => {
// Arrange
// tslint:disable-next-line: no-object-literal-type-assertion
const req = { body: { ssl_check: 1 } } as Request;
const req: Request = { body: { ssl_check: 1 } };
let sent = false;
// tslint:disable-next-line: no-object-literal-type-assertion
const resp = {
const resp: Response = {
send: () => {
sent = true;
},
} as Response;
};
let errorResult: any;
const next = (error: any) => {
errorResult = error;
Expand All @@ -291,14 +291,14 @@ describe('ExpressReceiver', function () {
it('should work with other requests', async () => {
// Arrange
// tslint:disable-next-line: no-object-literal-type-assertion
const req = { body: { type: 'block_actions' } } as Request;
const req: Request = { body: { type: 'block_actions' } };
let sent = false;
// tslint:disable-next-line: no-object-literal-type-assertion
const resp = {
const resp: Response = {
send: () => {
sent = true;
},
} as Response;
};
let errorResult: any;
const next = (error: any) => {
errorResult = error;
Expand All @@ -317,14 +317,14 @@ describe('ExpressReceiver', function () {
it('should handle valid requests', async () => {
// Arrange
// tslint:disable-next-line: no-object-literal-type-assertion
const req = { body: { type: 'url_verification', challenge: 'this is it' } } as Request;
const req: Request = { body: { type: 'url_verification', challenge: 'this is it' } };
let sentBody = undefined;
// tslint:disable-next-line: no-object-literal-type-assertion
const resp = {
const resp: Response = {
json: (body) => {
sentBody = body;
},
} as Response;
};
let errorResult: any;
const next = (error: any) => {
errorResult = error;
Expand All @@ -341,14 +341,14 @@ describe('ExpressReceiver', function () {
it('should work with other requests', async () => {
// Arrange
// tslint:disable-next-line: no-object-literal-type-assertion
const req = { body: { ssl_check: 1 } } as Request;
const req: Request = { body: { ssl_check: 1 } };
let sentBody = undefined;
// tslint:disable-next-line: no-object-literal-type-assertion
const resp = {
const resp: Response = {
json: (body) => {
sentBody = body;
},
} as Response;
};
let errorResult: any;
const next = (error: any) => {
errorResult = error;
Expand Down

0 comments on commit 79ef148

Please sign in to comment.