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

assetgraph-sprite

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assetgraph-sprite - npm Package Compare versions

Comparing version 0.2.7 to 0.2.8

test/spriteBackgroundImages/noGroupSelector/bar.png

2

lib/index.js

@@ -196,3 +196,3 @@ var _ = require('underscore'),

});
if (relationSpriteInfo.noGroupSelector) {
if (relationSpriteInfo.noGroupSelector || !spriteGroup.placeHolder) {
// The user specified that this selector needs its own background-image/background

@@ -199,0 +199,0 @@ // property pointing at the sprite rather than relying on the Html elements also being

@@ -5,3 +5,3 @@ {

"repository": "git://github.com/One-com/assetgraph-sprite.git",
"version": "0.2.7",
"version": "0.2.8",
"maintainers": [

@@ -8,0 +8,0 @@ {

@@ -7,5 +7,5 @@ var vows = require('vows'),

vows.describe('Sprite background images').addBatch({
'After loading a test case with images and spriting instructions': {
'After loading a simple test case with images and spriting instructions': {
topic: function () {
new AssetGraph({root: __dirname + '/spriteBackgroundImages'}).queue(
new AssetGraph({root: __dirname + '/spriteBackgroundImages/simple/'}).queue(
transforms.loadAssets('style.css'),

@@ -38,3 +38,3 @@ transforms.populate()

topic: function () {
new AssetGraph({root: __dirname + '/spriteBackgroundImages'}).queue(
new AssetGraph({root: __dirname + '/spriteBackgroundImages/simple/'}).queue(
transforms.loadAssets('style.css'),

@@ -58,3 +58,29 @@ transforms.populate(),

}
},
'After loading a simple test case with two background-images to be sprited, but with no group selector': {
topic: function () {
new AssetGraph({root: __dirname + '/spriteBackgroundImages/noGroupSelector/'}).queue(
transforms.loadAssets('style.css'),
transforms.populate()
).run(this.callback);
},
'the graph contains 2 Pngs': function (assetGraph) {
assert.equal(assetGraph.findAssets({type: 'Png'}).length, 2);
},
'then spriting the background images': {
topic: function (assetGraph) {
assetGraph.queue(require('../lib')()).run(this.callback);
},
'the number of Png assets should be down to one': function (assetGraph) {
assert.equal(assetGraph.findAssets({type: 'Png'}).length, 1);
},
'the graph should contain 2 CssImage relations': function (assetGraph) {
assert.equal(assetGraph.findRelations({type: 'CssImage'}).length, 2);
},
'the stylesheet should have the expected contents': function (assetGraph) {
assert.equal(assetGraph.findAssets({type: 'Css'})[0].text,
'.icon-foo{background-image:url(20.png);background-position:0 0}.icon-bar{background-image:url(20.png);background-position:-12px 0}');
}
}
}
})['export'](module);
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