Skip to content

Commit

Permalink
jest unit tests added
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuellr committed Aug 21, 2019
1 parent 9b364ac commit cd151b8
Show file tree
Hide file tree
Showing 3 changed files with 340 additions and 83 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import axios, { AxiosResponse } from 'axios';

interface SendPagerdutyOptions {
apiUrl: string;
data: any;
headers: Record<string, string>;
}

// post an event to pagerduty
export async function sendPagerduty(options: SendPagerdutyOptions): Promise<AxiosResponse> {
const { apiUrl, data, headers } = options;

return axios.post(apiUrl, data, { headers });
}
Loading

0 comments on commit cd151b8

Please sign in to comment.