protractor-nosync
Advanced tools
Comparing version 1.0.1 to 1.0.2
var wrap = function (browser, method) { | ||
return function () { | ||
var result; | ||
browser.ignoreSynchronization = true; | ||
method.apply(method, arguments); | ||
result = method.apply(method, arguments); | ||
browser.ignoreSynchronization = false; | ||
return result; | ||
}; | ||
@@ -13,3 +15,3 @@ } | ||
var noSync = function(method) { | ||
wrap(browser, method)(); | ||
return wrap(browser, method)(); | ||
} | ||
@@ -16,0 +18,0 @@ |
{ | ||
"name": "protractor-nosync", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A wrapper to execute arbitrary methods under protractor without browser synchronization.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -10,3 +10,4 @@ var chai = require("chai"); | ||
describe('Protractor-NoSync Wrapped Object Method', function () { | ||
var browser, obj, nosync, arg1, arg2; | ||
var browser, obj, nosync, arg1, arg2, result; | ||
var data = { value: 42 }; | ||
@@ -19,3 +20,3 @@ before(function () { | ||
obj = { | ||
spy: sinon.spy() | ||
spy: sinon.stub().returns(data) | ||
}; | ||
@@ -36,3 +37,3 @@ | ||
nosync.spy(arg1, arg2); | ||
result = nosync.spy(arg1, arg2); | ||
}); | ||
@@ -58,6 +59,11 @@ | ||
}); | ||
it('should properly return results of the method.', function () { | ||
expect(result).to.equal(data); | ||
}); | ||
}); | ||
describe('Protractor-NoSync Wrapped Code Block', function () { | ||
var browser, obj, nosync, arg1, arg2, spy; | ||
var browser, obj, nosync, arg1, arg2, spy, result; | ||
var data = { value: 42 }; | ||
@@ -69,3 +75,3 @@ before(function () { | ||
// Set up test fixtures. | ||
spy = sinon.spy(); | ||
spy = sinon.stub().returns(data); | ||
@@ -85,4 +91,4 @@ // Setup protractor browser mock. Sinon does not directly support getters and setters so work around that. | ||
nosync(function () { | ||
spy(arg1, arg2); | ||
result = nosync(function () { | ||
return spy(arg1, arg2); | ||
}); | ||
@@ -109,2 +115,6 @@ }); | ||
}); | ||
it('should properly return results of the block.', function () { | ||
expect(result).to.equal(data); | ||
}); | ||
}); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
9280
112
0
1