Skip to content

Commit 89f7e89

Browse files
committed
tests: migrate jest.mock from uuid to crypto
1 parent b833f35 commit 89f7e89

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

notifiers/toaster.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
const path = require('path');
55
const notifier = path.resolve(__dirname, '../vendor/ntfyToast/ntfytoast');
66
const utils = require('../lib/utils');
7-
const crypto = require('crypto');
87
const Balloon = require('./balloon');
8+
const crypto = require('crypto');
9+
910
// const os = require('os');
1011

1112
const EventEmitter = require('events').EventEmitter;

test/toaster.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ const utils = require('../lib/utils');
33
const path = require('path');
44
const os = require('os');
55
const testUtils = require('./_test-utils');
6-
jest.mock('uuid', () => {
7-
return { v4: () => '123456789' };
8-
});
6+
jest.mock('crypto', () => ({ randomUUID: () => '123456789' }));
97

108
describe('WindowsToaster', function () {
119
const original = utils.fileCommand;

0 commit comments

Comments
 (0)