Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ilya Vysotski
Koa Shopify Auth
Commits
8e81ac04
Commit
8e81ac04
authored
Oct 11, 2020
by
Anthony Morris
Browse files
Add test for safe-compare
parent
9267d45b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/auth/test/safe-compare.test.ts
0 → 100644
View file @
8e81ac04
import
safeCompare
from
'
../safe-compare
'
const
hmac
=
'
7c66606415117ff9744a2a9b2be1712a15928b5ef474ab1a9ff5dc36b7dcaed8
'
;
describe
(
'
safeCompare
'
,
()
=>
{
it
(
'
returns true when values are the same
'
,
()
=>
{
expect
(
safeCompare
(
hmac
,
hmac
)).
toBe
(
true
);
});
it
(
'
returns false when values are different
'
,
()
=>
{
expect
(
safeCompare
(
hmac
,
'
not hmac
'
)).
toBe
(
false
);
});
});
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment