amalgamatic-drupal6
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -0,1 +1,3 @@ | ||
## [**4.0.3**](https://github.com/ucsf-ckm/amalgamatic-drupal6/issues?milestone=9&q=is%3Aclosed) | ||
- [**19**](https://github.com/ucsf-ckm/amalgamatic-drupal6/issues/19) https only | ||
@@ -2,0 +4,0 @@ ## [**4.0.2**](https://github.com/ucsf-ckm/amalgamatic-drupal6/issues?milestone=8&state=closed) |
var cheerio = require('cheerio'); | ||
var http = require('http'); | ||
var https = require('https'); | ||
var extend = require('util-extend'); | ||
@@ -7,3 +7,3 @@ var url = require('url'); | ||
var options = { | ||
url: 'http://www.library.ucsf.edu/search/node' | ||
url: 'https://www.library.ucsf.edu/search/node' | ||
}; | ||
@@ -28,3 +28,3 @@ | ||
http.get(myOptions, function (res) { | ||
https.get(myOptions, function (res) { | ||
var rawData = ''; | ||
@@ -31,0 +31,0 @@ |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"dependencies": { | ||
@@ -21,4 +21,5 @@ "cheerio": "^0.17.0", | ||
"devDependencies": { | ||
"code": "^1.4.1", | ||
"jshint": "^2.5.5", | ||
"lab": "^4.4.4", | ||
"lab": "^5.14.0", | ||
"nock": "^0.47.0", | ||
@@ -25,0 +26,0 @@ "precommit-hook": "^1.0.7", |
@@ -21,3 +21,3 @@ [![Build Status](https://travis-ci.org/ucsf-ckm/amalgamatic-drupal6.svg?branch=master)](https://travis-ci.org/ucsf-ckm/amalgamatic-drupal6) | ||
// Set the URL to point to your Drupal 6 search page | ||
drupal6.setOptions({url: 'http://www.library.ucsf.edu/search/node'}); | ||
drupal6.setOptions({url: 'https://www.library.ucsf.edu/search/node'}); | ||
@@ -24,0 +24,0 @@ // Add this plugin to your Amalgamatic instance along with any other plugins you've configured. |
@@ -12,3 +12,5 @@ /*jshint expr: true*/ | ||
var expect = Lab.expect; | ||
var Code = require('code'); | ||
var expect = Code.expect; | ||
var describe = lab.experiment; | ||
@@ -76,3 +78,3 @@ var it = lab.test; | ||
it('returns results if a non-ridiculous search term is provided', function (done) { | ||
nock('http://www.library.ucsf.edu') | ||
nock('https://www.library.ucsf.edu') | ||
.get('/search/node/medicine') | ||
@@ -89,3 +91,3 @@ .reply(200, '<dl class="search-results node-results"><dt class="title"><a href="http://example.com/1">Medicine 1</a></dt><dt class="title"><a href="http://example.com/2">Medicine 2</a></dt></dl>'); | ||
it('returns an empty result if ridiculous search term is provided', function (done) { | ||
nock('http://www.library.ucsf.edu') | ||
nock('https://www.library.ucsf.edu') | ||
.get('/search/node/fhqwhgads') | ||
@@ -106,3 +108,3 @@ .reply(200, '<dl class="search-results node-results"></dl>'); | ||
expect(result).to.be.not.ok; | ||
expect(err.message).to.equal('Nock: Not allow net connect for "www.library.ucsf.edu:80"'); | ||
expect(err.message).to.equal('Nock: Not allow net connect for "www.library.ucsf.edu:443"'); | ||
done(); | ||
@@ -113,7 +115,7 @@ }); | ||
it('should use host,port, and path options if they are passed', function (done) { | ||
nock('http://example.com:8000') | ||
nock('https://example.com:8000') | ||
.get('/path/medicine') | ||
.reply(200, '<dl class="search-results node-results"><dt class="title"><a href="http://example.com/path/result">Medicine</a></dt></dl>'); | ||
drupal6.setOptions({url: 'http://example.com:8000/path'}); | ||
drupal6.setOptions({url: 'https://example.com:8000/path'}); | ||
drupal6.search({searchTerm: 'medicine'}, function (err, result) { | ||
@@ -127,10 +129,10 @@ expect(err).to.be.not.ok; | ||
it('should return a link to all results', function (done) { | ||
nock('http://example.com') | ||
nock('https://example.com') | ||
.get('/path/medicine') | ||
.reply(200, '<dl class="search-results node-results"><dt class="title"><a href="http://example.com/path/result">Medicine</a></dt></dl>'); | ||
drupal6.setOptions({url: 'http://example.com/path'}); | ||
drupal6.setOptions({url: 'https://example.com/path'}); | ||
drupal6.search({searchTerm: 'medicine'}, function (err, result) { | ||
expect(err).to.be.not.ok; | ||
expect(result.url).to.equal('http://example.com/path/medicine'); | ||
expect(result.url).to.equal('https://example.com/path/medicine'); | ||
done(); | ||
@@ -141,3 +143,3 @@ }); | ||
it('should set withCredentials to false for browserify', function (done) { | ||
revert = drupal6.__set__({http: {get: function (options) { | ||
revert = drupal6.__set__({https: {get: function (options) { | ||
expect(options.withCredentials).to.be.false; | ||
@@ -144,0 +146,0 @@ done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
11349
157
6