New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

get-visible-rect

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-visible-rect - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

3

buster.js

@@ -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();
})
})
});
};

10

package.json
{
"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) ##
[![Build Status](https://travis-ci.org/insidewarehouse/get-visible-rect.svg?branch=master)](https://travis-ci.org/insidewarehouse/get-visible-rect)
[![Sauce Test Status](https://saucelabs.com/browser-matrix/iw-get-visible-rect.svg)](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

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