Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-horseman

Package Overview
Dependencies
Maintainers
2
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-horseman - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

5

CHANGELOG.md
# Change Log
All notable changes to this project will be documented in this file.
## 3.0.1 - 2016-04-12
### Fixed
- .injectJs() now properly rejects when it fails
- #158 - bug with `injectBluebird` option
## 3.0.0 - 2016-04-06

@@ -5,0 +10,0 @@ ### Added

17

lib/actions.js

@@ -555,8 +555,15 @@ 'use strict';

var self = this;
return this.ready.then(function() {
return HorsemanPromise.fromCallback(function(done) {
debug('.injectJs()', file);
return self.page.injectJs(file, done);
return this.ready
.then(function() {
return HorsemanPromise.fromCallback(function(done) {
debug('.injectJs()', file);
return self.page.injectJs(file, done);
});
})
.tap(function(successful) {
if (!successful) {
var err = new Error('failed to inject ' + file);
return HorsemanPromise.reject(err);
}
});
});
};

@@ -563,0 +570,0 @@

@@ -299,5 +299,9 @@ 'use strict';

return HorsemanPromise.fromCallback(function(done) {
page.injectJs(jQueryLocation, done);
return page.injectJs(jQueryLocation, done);
})
.tap(function() {
.tap(function(successful) {
if (!successful) {
var err = new Error('jQuery injection failed');
return HorsemanPromise.reject(err);
}
debug('injected jQuery');

@@ -325,10 +329,12 @@ });

var bluebirdLocation = path.join(__dirname,
'../node_modules/bluebird/js/browser/bluebird' +
(self.options.bluebirdDebug ? '' : '.min') +
'.js');
var bbLoc = 'bluebird/js/browser/bluebird' +
(self.options.bluebirdDebug ? '' : '.min') + '.js';
return HorsemanPromise.fromCallback(function(done) {
return page.injectJs(bluebirdLocation, done);
return page.injectJs(require.resolve(bbLoc), done);
})
.tap(function() {
.tap(function(successful) {
if (!successful) {
var err = new Error('bluebird injection failed');
return HorsemanPromise.reject(err);
}
debug('injected bluebird');

@@ -335,0 +341,0 @@ });

{
"name": "node-horseman",
"version": "3.0.0",
"version": "3.0.1",
"description": "Run PhantomJS from Node",

@@ -5,0 +5,0 @@ "repository": {

@@ -708,2 +708,14 @@ 'use strict';

it('should reject when inject javascript fails', function() {
var horseman = new Horseman({
timeout: defaultTimeout,
injectJquery: bool
});
return horseman
.open(serverUrl)
.injectJs('test/files/not_a_real_file.js')
.close()
.should.be.rejected();
});
it('should include javascript', function() {

@@ -710,0 +722,0 @@ var horseman = new Horseman({

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc