get-visible-rect
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -11,3 +11,6 @@ var config = module.exports; | ||
"test/*.test.js" | ||
], | ||
extensions: [ | ||
require("buster-reporter-sauce") | ||
] | ||
}; |
@@ -6,17 +6,81 @@ module.exports = function (grunt) { | ||
files: [ "index.js", "test/**.js" ], | ||
tasks: [ "test" ] | ||
tasks: [ "buster:local:test" ] | ||
} | ||
}, | ||
buster: { | ||
local: { | ||
} | ||
}, | ||
open: { | ||
"capture-browser": { | ||
path: "http://127.0.0.1:1111/capture" | ||
} | ||
}, | ||
"saucelabs-custom": { | ||
dist: { | ||
reporter: "specification" | ||
options: { | ||
testname: "get-visible-rect via buster-static", | ||
browsers: [ | ||
{ browserName: 'internet explorer', platform: "Windows 8.1", version: '11' }, | ||
{ browserName: 'internet explorer', platform: "Windows 7", version: '11' }, | ||
{ browserName: 'internet explorer', platform: "Windows 7", version: '10' }, | ||
{ browserName: 'firefox', platform: "Windows 8.1" }, | ||
{ browserName: 'firefox', platform: "Windows 7" }, | ||
{ browserName: 'firefox', platform: "OS X 10.9" }, | ||
{ browserName: 'firefox', platform: "Linux" }, | ||
{ browserName: 'chrome', platform: "Windows 8.1" }, | ||
{ browserName: 'chrome', platform: "Windows 7" }, | ||
{ browserName: 'chrome', platform: "OS X 10.9" }, | ||
{ browserName: 'chrome', platform: "Linux" }, | ||
{ browserName: 'safari', platform: "OS X 10.9" } | ||
], | ||
urls: [ | ||
"http://127.0.0.1:8000/?reporter=sauce" | ||
] | ||
} | ||
} | ||
} | ||
}); | ||
grunt.loadNpmTasks("grunt-buster"); | ||
grunt.loadNpmTasks("grunt-open"); | ||
grunt.loadNpmTasks("grunt-saucelabs"); | ||
grunt.loadNpmTasks("grunt-contrib-watch"); | ||
grunt.loadNpmTasks("grunt-release"); | ||
grunt.registerTask("default", ["test"]); | ||
grunt.registerTask("test", ["buster"]); | ||
grunt.registerTask("default", [ "test" ]); | ||
grunt.registerTask("test", [ process.env.SAUCE_USERNAME ? "test-sauce" : "test-local" ]); | ||
grunt.registerTask("test-sauce", [ "buster-static", "saucelabs-custom" ]); | ||
grunt.registerTask("test-local", [ "buster:local:server", "open:capture-browser", "buster:local:test" ]); | ||
grunt.registerTask("start-dev", [ "buster:local:server", "open:capture-browser", "watch" ]); | ||
grunt.registerTask("buster-static", function () { | ||
// @todo: move buster-static task to grunt-buster package | ||
var done = this.async(); | ||
var resolveBin = require("resolve-bin"), | ||
cp = require('child_process'); | ||
resolveBin("buster", { executable: "buster-static" }, function (e, busterStaticBinPath) { | ||
if (e) { | ||
grunt.fail.fatal(e); | ||
return; | ||
} | ||
grunt.log.writeln("Spawning " + busterStaticBinPath + " --port 8000"); | ||
var busterStaticProcess = cp.spawn(process.execPath, [ busterStaticBinPath, "--port", "8000" ], { | ||
env: process.env, | ||
setsid: true | ||
}); | ||
busterStaticProcess.stdout.once('data', function () { | ||
done(); | ||
}); | ||
busterStaticProcess.stderr.on('data', function (data) { | ||
grunt.fail.fatal(data); | ||
}); | ||
process.on("exit", function () { | ||
busterStaticProcess.kill(); | ||
}) | ||
}) | ||
}); | ||
}; |
{ | ||
"name": "get-visible-rect", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Calculates the visible portion of the element inside the viewport", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node ./node_modules/grunt-cli/bin/grunt test" | ||
"test": "node ./node_modules/grunt-cli/bin/grunt", | ||
"start": "node ./node_modules/grunt-cli/bin/grunt start-dev" | ||
}, | ||
@@ -26,2 +27,3 @@ "repository": { | ||
"buster": "0.7.x", | ||
"buster-reporter-sauce": "0.1.x", | ||
"grunt": "0.4.x", | ||
@@ -31,5 +33,7 @@ "grunt-buster": "0.3.x", | ||
"grunt-contrib-watch": "0.6.x", | ||
"grunt-open": "0.2.x", | ||
"grunt-release": "0.7.x", | ||
"phantomjs": "1.9.x" | ||
"grunt-saucelabs": "8.x", | ||
"resolve-bin": "0.3.x" | ||
} | ||
} |
## getVisibleRect(el) ## | ||
[](https://travis-ci.org/insidewarehouse/get-visible-rect) | ||
[](https://saucelabs.com/u/iw-get-visible-rect) | ||
@@ -5,0 +6,0 @@ Note: tests are failing, because they only run in PhantomJS on travis for now - enabling real browsers soon. |
@@ -54,2 +54,6 @@ (function () { | ||
"tearDown": function () { | ||
this.iframe.parentNode.removeChild(this.iframe); | ||
}, | ||
"testcase should be set up correctly": function () { | ||
@@ -56,0 +60,0 @@ expect(this.iframe).toBeDefined(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
50355
283
30
10
2
1