From 462461d1fb805462351cd83f0d9f44eccab9c9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=BA?= Date: Sun, 8 Nov 2015 10:38:06 +0700 Subject: [PATCH] Create credential-tests.ts --- credential/credential-tests.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 credential/credential-tests.ts diff --git a/credential/credential-tests.ts b/credential/credential-tests.ts new file mode 100644 index 000000000..6adec112f --- /dev/null +++ b/credential/credential-tests.ts @@ -0,0 +1,16 @@ +/// + +import * as credential from 'credential'; + +credential.hash('password', function(err: Error, hash: string) { + if (err) console.error(err); + else console.log(hash); +}); + +const hash = '{}'; +const password = 'test'; + +credential.verify(hash, password, function(err: Error, isValid: boolean) { + if (err) console.error(err); + else console.log(isValid ? 'Password match' : 'Incorrect password'); +});