From c603ac5d302ac360a063997b8c75bf59ee1e5f16 Mon Sep 17 00:00:00 2001 From: Camille Drapier Date: Tue, 28 Dec 2021 16:47:41 +0900 Subject: [PATCH] Restore and fix tests --- test/downloadoptions.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/test/downloadoptions.js b/test/downloadoptions.js index 811ada1c9..37879d497 100644 --- a/test/downloadoptions.js +++ b/test/downloadoptions.js @@ -68,6 +68,24 @@ describe('util', function() { }); }); + describe('with SASS_REJECT_UNAUTHORIZED set to false', function() { + + beforeEach(function() { + process.env.SASS_REJECT_UNAUTHORIZED = '0'; + }); + + it('should look as we expect', function() { + var expected = { + strictSSL: false, + timeout: 60000, + headers: { + 'User-Agent': ua(), + }, + }; + assert.deepStrictEqual(opts(), expected); + }); + }); + describe('with SASS_REJECT_UNAUTHORIZED set to true', function() { beforeEach(function() { process.env.SASS_REJECT_UNAUTHORIZED = '1'; @@ -75,12 +93,11 @@ describe('util', function() { it('should look as we expect', function() { var expected = { - rejectUnauthorized: true, + strictSSL: true, timeout: 60000, headers: { 'User-Agent': ua(), }, - encoding: null, }; assert.deepStrictEqual(opts(), expected); @@ -94,12 +111,11 @@ describe('util', function() { it('should look as we expect', function() { var expected = { - rejectUnauthorized: true, + strictSSL: true, timeout: 60000, headers: { 'User-Agent': ua(), }, - encoding: null, }; assert.deepStrictEqual(opts(), expected);