From 12f286143ef6ea1ae5c6cf8d226413f5483fd360 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 4 Feb 2016 17:42:25 -0500 Subject: [PATCH] Docs: add information on writing tests in babylon --- CONTRIBUTING.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 65cb594656..3a4194ae45 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,6 +78,23 @@ To test the code coverage, use: $ make test-cov ``` +#### Writing tests + +When writing tests in `babylon`, you can easily generate an `expected.json` automatically by just providing the `actual.js` and running `make test-only` like normal. + +```js +// Example +- babylon + - test + - fixtures + - comments + - basic + - block-trailing-comment + - actual.js + - expected.json (will be generated if not created) +``` + + #### Internals Please see [`/doc`](/doc) for internals documentation relevant to developing babel.