Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Latest commit

 

History

History
126 lines (98 loc) · 2.2 KB

File metadata and controls

126 lines (98 loc) · 2.2 KB
id development
title Development

Getting started

Clone

git clone git@github.com:qlik-oss/after-work.js.git

Installation

Ensure you have yarn installed globally:

npm i -g yarn

Go into the cloned folder:

yarn

Testing

Run all tests with:

npm test

This will run all after-work.js tests with after-work.js itself.

Debugging

For easy debugging using vscode just add a .vscode/launch.json.

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "NodeRunner",
      "program": "${workspaceRoot}/commands/aw/src/index.js",
      "args": [
        "-c",
        "aw.config.js",
        "--glob",
        "${file}"
      ]
    },
    {
      "type": "node",
      "request": "launch",
      "name": "ChromeRunner",
      "program": "${workspaceRoot}/commands/aw/src/index.js",
      "args": [
        "chrome",
        "-c",
        "aw.config.js",
        "--glob",
        "${file}"
      ]
    },
    {
      "type": "chrome",
      "request": "launch",
      "name": "ChromeHeadless",
      "port": 9222,
      "url": "http://localhost:9676/examples/index.html",
      "webRoot": "${workspaceFolder}",
      "runtimeArgs": [
        "--headless",
        "--disable-gpu"
      ]
    }
  ],
  "compounds": [
    {
      "name": "ChromeDebug",
      "configurations": [
        "ChromeHeadless",
        "ChromeRunner"
      ]
    }
  ]
}


Add a breakpoint in any *.{js,ts} and hit F5 and off you go...

Debugging with Chrome

To debug in Chrome just pass:

npx aw chrome -c aw.config.js --chrome.devtools=true

This will ensure to auto open devtools in your Chrome instance and waiting for it to attach. Add a debugger statement in any file and it will break right into it 🚀.

Testing local changes

after-work.js is designed to be run directly without installing it. Just go into the project you want to test and point to your local entry point:

../after-work.js/commands/aw/src/index.js

This will run after-work.js with your local changes 💥.