We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29a048e commit d93353cCopy full SHA for d93353c
test/hmac.test.ts
@@ -0,0 +1,17 @@
1
+import { createHmacSignature } from '@apify/utilities';
2
+
3
+describe('createHmacSignature()', () => {
4
+ it('should create a valid HMAC signature', () => {
5
+ const secretKey = 'hmac-secret-key';
6
+ const message = 'hmac-message-to-be-authenticated';
7
+ expect(createHmacSignature(secretKey, message)).toBe('pcVagAsud2gqKY2qCy2G');
8
+ });
9
10
+ it('should create same HMAC signature, when secretKey and message are same', () => {
11
+ const secretKey = 'hmac-same-secret-key';
12
+ const message = 'hmac-same-message-to-be-authenticated';
13
+ for (let i = 0; i < 5; i++) {
14
+ expect(createHmacSignature(secretKey, message)).toBe('FYMcmTIm2sQ68EcG8yyQ');
15
+ }
16
17
+});
0 commit comments