From abb9bf27429f878881ee669118cce72d6e91e810 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 17 Nov 2015 17:49:14 +0700 Subject: [PATCH 1/3] add maintaining.md for the project maintainers --- maintaining.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 maintaining.md diff --git a/maintaining.md b/maintaining.md new file mode 100644 index 000000000..1ee3ec4ee --- /dev/null +++ b/maintaining.md @@ -0,0 +1,8 @@ +# Maintaining + +## Release process + +- Bump dependencies. +- Ensure [Travis CI](https://travis-ci.org/sindresorhus/ava) and [AppVeyor](https://ci.appveyor.com/project/sindresorhus/ava/branch/master) are green. +- Publish a new version using [`np`](https://github.com/sindresorhus/np) with a version number according to [semver](http://semver.org). +- Write a [release note](https://github.com/sindresorhus/ava/releases/new) following the style of previous release notes. From 80206ef7adb5cd032340de5be1b491864f2b0403 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 17 Nov 2015 17:49:14 +0700 Subject: [PATCH 2/3] add maintaining.md for the project maintainers --- maintaining.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintaining.md b/maintaining.md index 1ee3ec4ee..dc1778a61 100644 --- a/maintaining.md +++ b/maintaining.md @@ -1,8 +1,14 @@ # Maintaining + ## Release process - Bump dependencies. - Ensure [Travis CI](https://travis-ci.org/sindresorhus/ava) and [AppVeyor](https://ci.appveyor.com/project/sindresorhus/ava/branch/master) are green. - Publish a new version using [`np`](https://github.com/sindresorhus/np) with a version number according to [semver](http://semver.org). - Write a [release note](https://github.com/sindresorhus/ava/releases/new) following the style of previous release notes. + + +## Pull requests + +New features should come with tests and documentation. From 70348aa41d9bc6e82a9ac278cbedf7183835cb25 Mon Sep 17 00:00:00 2001 From: James Talmage Date: Mon, 16 Nov 2015 17:31:22 -0500 Subject: [PATCH 3/3] add covenience utility for debugging document debug script --- debug.js | 16 ++++++++++++++++ maintaining.md | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100755 debug.js diff --git a/debug.js b/debug.js new file mode 100755 index 000000000..3561aa850 --- /dev/null +++ b/debug.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +'use strict'; + +var onExit = require('signal-exit'); +var serializeValue = require('./lib/serialize-value'); +var chalk = require('chalk'); + +process.send = function (data) { + console.log(chalk.magenta(JSON.stringify(serializeValue(data), null, 4))); +}; + +onExit(function () { + process.emit('ava-cleanup', true); +}); + +require('./lib/babel'); diff --git a/maintaining.md b/maintaining.md index dc1778a61..a8c84b642 100644 --- a/maintaining.md +++ b/maintaining.md @@ -1,5 +1,26 @@ # Maintaining +## IPC Debugging + +AVA makes heavy use of forked processes and Node [IPC](https://nodejs.org/api/process.html#process_process_send_message_sendhandle_callback). + This can create some difficulty tracking down bugs that occur in a different process from your test code. + The script `debug.js` will launch a single test fixture without forking the process and will log the IPC messages + that would normally be sent parent process. + +```sh +$ debug.js test/fixture/async-await.js +.... +{ + "name": "test", + "data": { + "duration": 5, + "title": "async function", + "error": {}, + "type": "test" + } +} +.... +``` ## Release process