UNPKG

gpii-universal

Version:

Cross platform, core components of the GPII personalization infrastructure.

44 lines (33 loc) 1.08 kB
/*! GPII User Errors Tests Copyright 2018 OCAD University Licensed under the New BSD license. You may not use this file except in compliance with this License. You may obtain a copy of the License at https://github.com/GPII/universal/blob/master/LICENSE.txt */ /* eslint-env browser */ /* eslint strict: ["error", "function"] */ /* global jqUnit, fluid */ (function () { "use strict"; var gpii = fluid.registerNamespace("gpii"); jqUnit.test("Test gpii.userErrors.isConnectionError()", function () { var testCases = [{ code: "ECONNREFUSED", expected: true }, { code: "ETIMEDOUT", expected: true }, { code: "ECONNRESET", expected: true }, { code: "NONERROR", expected: false }]; fluid.each(testCases, function (oneTestCase) { jqUnit.assertEquals("The return on the connection error code is expected", oneTestCase.expected, gpii.userErrors.isConnectionError(oneTestCase.code)); }); }); })();