From 123513286f8baadb97c27468690b5bdf335dcecc Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 16 Jul 2010 00:06:17 +0200 Subject: Passwords library with unit test. --- tests/test-password.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/test-password.js (limited to 'tests/test-password.js') diff --git a/tests/test-password.js b/tests/test-password.js new file mode 100644 index 0000000..e605dc4 --- /dev/null +++ b/tests/test-password.js @@ -0,0 +1,18 @@ +/*jslint forin: true, rhino: true, onevar: false, browser: true, evil: true, laxbreak: true, undef: true, nomen: true, eqeqeq: true, bitwise: true, maxerr: 1000, immed: false, white: false, plusplus: false, regexp: false, undef: false */ +// Released under the MIT/X11 license +// http://www.opensource.org/licenses/mit-license.php +"use strict"; +var passMod = require("passwords"); +var BTSRealm = "BTSTest"; +var testLogin = "testUser"; +var testPass = "verySecret"; +var testDomain = "http://www.example.com"; + +exports.ensureSetPassword = function (test) { + passMod.setPassword(testLogin, testPass, + testDomain, BTSRealm); + test.assertEqual(passMod.getPassword(testLogin, + testDomain, BTSRealm), testPass, ""); + passMod.removePassword(testLogin, testPass, + testDomain, BTSRealm); +}; -- cgit