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

after-work.js

Package Overview
Dependencies
Maintainers
6
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

after-work.js

Unified testing framework

  • 4.3.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

after-work.js

CircleCI Greenkeeper badge Coverage Status

after-work.js is an unified test framework highly configurable through cli and configuration files allowing tests to be executed in the desired context.

Requirements

Default runner

  • node: Node.js >= 8.9.4

Context dependent

  • cdp (Chrome Debugging Protocol): Chrome > 61
  • protractor (webdriver protocol): protractor 5.x + browser(s)
  • puppeteer (High-level Headless Chrome Node API - experimental): puppeteer

Introduction

after-work.js aims to be a tool that facilitates the testing while development or restructuring code. Designed for test and provide fast feedback on changed code and added testcases.

To configure after-work.js you need to start with an analyse of the code.

  • What context should it be executed in (Node.js, browser)
  • What type of tests should be executed (unit, component, integration, e2e)
  • Does the code have any dependencies to build or run (babel...)

Get started

Installation

Install the module using npm:

npm install --save-dev after-work.js

CLI entrypoint

after-work.js is CLI and consists of a command together with appropriate options Help is always available with the --help, -h option

aw <command>

Commands:
  aw node        Run tests in node                                                         [default]
  aw protractor  Run protractor                                                      [aliases: ptor]
  aw cdp         Run tests with cdp (chrome devtools protocol)                     [aliases: chrome]
  aw serve       Serve files
  aw puppeteer   Run tests with puppeteer                                          [aliases: puppet]

All commands support passing a config file for all options.

npx aw -c ./path/to/aw.config.js

However, passing an option from command line will override the config file option.

npx aw -c ./path/to/aw.config.js --glob /path/that/overrides/glob/in/config/file

This enables easy debugging setup from modern editors for example Visual Studio Code

This will only run the current active file. And you don't have to worry about your tests timing out since after-work.js will automatically detect running a debugger and set the appropriate options accordingly.

Included Tools

The following tools are bundled into after-work.js:

  • Mocha: an extensible testing framework for TDD or BDD.
  • Chai: an assertion library used together with a JavaScript testing framework.
  • Sinon: a framework for standalone test spies, stubs and mocks for JavaScript.
  • Nyc: the Istanbul command line interface

Examples

Browser

Contributing

Please follow the instructions in CONTRIBUTING.md.

FAQs

Package last updated on 24 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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