Skip to content

A css/js coverage tool for websites

Notifications You must be signed in to change notification settings

scurker/quilted

Repository files navigation

quilted logo

quilted

Build Status Coverage Status npm

A css/js coverage tool for websites built using Puppeteer.

Quilted Cli

Installation

With npm:

npm install --save quilted

With yarn:

yarn add quilted

Usage

CLI

quilted <url> [options]

Module

import quilted from 'quilted';

quilted('https://example.com').then(coverage => {
  // ...
});

CLI

$ quilted --help

Usage: quilted <url> [options]

Basic options:
  --no-css      disables css code coverage                             [boolean]
  --no-js       disables js code coverage                              [boolean]
  --origin, -o  only cover same-origin assets                          [boolean]

Puppeteer options:
  --timeout, -t           maximum number of milliseconds to wait for the browser
                          to start                                      [number]
  --viewportWidth, --vw   sets viewport width for page render           [number]
  --viewportHeight, --vh  sets viewport height for page render          [number]
  --viewport, -V          sets viewport for page render i.e. 800x600    [string]
  --userAgent, --ua       sets the user agent for the request           [string]
  --headers, -H           sets headers for the page request
                          example: $0 <url> -H "X-Header: 123"           [array]

Options:
  --version, -v  Show version number                                   [boolean]
  --help         Show help                                             [boolean]

Module Options

Option Description Default
js Run js coverage. true
css Run css coverage. true
sameOrigin Only cover requests from the same origin false

Puppeteer Supported Options

Option Description Default
args Chrome command line flags null
timeout Maximum number of milliseconds to wait for the browser to start 30000
cookies Set cookies for the page request. null
headers Set headers for the page request. null
userAgent Sets the user agent for the page request. Default Chrome Headless User Agent String
viewport Sets the viewport size for the page request. 800x600

License

MIT