Skip to content

Commit

Permalink
add css option - fixes #228
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVerschueren committed Feb 3, 2016
1 parent 855e092 commit faab847
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -13,7 +13,7 @@
"node": ">=0.12.0"
},
"scripts": {
"test": "xo && npm run prepublish && nyc ava",
"test": "xo && npm run prepublish && nyc ava --serial",
"prepublish": "babel lib --out-dir=dist --optional=runtime",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
Expand Down Expand Up @@ -69,7 +69,7 @@
"plur": "^2.0.0",
"protocolify": "^1.0.0",
"rimraf": "^2.2.8",
"screenshot-stream": "^3.0.0",
"screenshot-stream": "^3.1.0",
"viewport-list": "^4.0.1"
},
"devDependencies": {
Expand Down
6 changes: 6 additions & 0 deletions readme.md
Expand Up @@ -51,6 +51,12 @@ Default: `false`

Crop to the set height.

##### css

Type: `string`

Apply custom CSS to the webpage. Specify some CSS or the path to a CSS file.

##### cookies

Type: `array` of `string`, `object`
Expand Down
9 changes: 9 additions & 0 deletions test/test.js
Expand Up @@ -74,6 +74,15 @@ test('crop image using the `crop` option', async t => {
t.is(size.height, 768);
});

test('have a `css` option', async t => {
const streams = await new Pageres({delay: 2, css: 'body { background-color: red; }'}).src('http://todomvc.com', ['1024x768']).run();
const png = new PNG(await getStream.buffer(streams[0]));
const pixels = await rfpify(png.decode.bind(png), Promise)();
t.is(pixels[0], 255);
t.is(pixels[1], 0);
t.is(pixels[2], 0);
});

test('rename image using the `filename` option', async t => {
const streams = await new Pageres()
.src('http://todomvc.com', ['1024x768'], {
Expand Down

0 comments on commit faab847

Please sign in to comment.