Skip to content

Instantly share code, notes, and snippets.

@busterc
Created October 9, 2018 15:56
Show Gist options
  • Save busterc/a74640ae11df1d288da6021b8cfcfb37 to your computer and use it in GitHub Desktop.
Save busterc/a74640ae11df1d288da6021b8cfcfb37 to your computer and use it in GitHub Desktop.
[always npm run post* using TRAP] when you need to npm run post* after failures #npm #npm-scripts

always npm run post* using trap

just trap it

{
  "scripts": {
    "pretest": "docker-compose up",
    "test": "trap 'npm run posttest && exit 1' ERR ; jest --coverage",
    "posttest": "docker-compose down"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment