Skip to content

How to run with nodemon or chokidar? #256

@bburns

Description

@bburns

Just in case someone needs this - this will keep running riteway as changes are made to the source or test files. Couldn't get it to work with nodemon but chokidar-cli works - it uses chokidar to monitor files and run a command after any changes.

Install chokidar-cli - https://github.com/kimmobrunfeldt/chokidar-cli

npm install --save-dev chokidar-cli

Update the test script in package.json - the --command option specifies the command to run after any of the specified files change, and --initial tells chokidar to run the command once on start -

{
  "name": "ta",
  "version": "0.1.0",
  "scripts": {
    "test": "chokidar \"src/**/*.js\" --initial --command \"riteway -r esm src/**/*.test.js | tap-nirvana\""
  },
  "license": "ISC",
  "devDependencies": {
    "chokidar-cli": "^2.1.0",
    "esm": "^3.2.25",
    "riteway": "^6.1.2",
    "tap-nirvana": "^1.1.0"
  }
}

Then just

npm test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions