Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zjw93615 committed Mar 15, 2023
1 parent dfc8133 commit c342825
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/utils/SendFn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// 图片上报
import {ReportContent} from "../interface";

/* report log by img url function */
Expand Down
13 changes: 7 additions & 6 deletions tests/SendFn.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import {beacon, sendImage} from "../src/utils/SendFn";

const LOAD_FAILURE_SRC = 'LOAD_FAILURE_SRC';
const LOAD_SUCCESS_SRC = 'LOAD_SUCCESS_SRC';


describe('Check SendFn', () => {
afterEach(() => {
jest.clearAllMocks();
jest.clearAllTimers();
global.Image = window.Image;
});

it('sendImage method', () => {
sendImage({}, '')
Expand All @@ -16,4 +12,9 @@ describe('Check SendFn', () => {
it('beacon method', () => {
beacon({}, '')
});

it('sendBeacon method', () => {
navigator.sendBeacon = jest.fn()
beacon({}, '')
});
})

0 comments on commit c342825

Please sign in to comment.