From 4bba2d3846b05dbabd3a5e3a5f4592167e2a609e Mon Sep 17 00:00:00 2001 From: shilal Date: Wed, 15 Apr 2020 18:50:40 +0000 Subject: [PATCH] Updated `make test`, the readme, and the contribution guide --- CONTRIBUTING.md | 2 +- Makefile | 1 + README.md | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b38b130e..a1fe3077 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ Once you're ready, open a [pull request](https://github.com/hound-search/hound/c your changes (you can read more about pull requests on GitHub [here](http://help.github.com/pull-requests/)). When you send a pull request, please be sure to include: -- unit tests that validate that your changes work as expected +- unit tests that validate that your changes work as expected (both for Go and for JavaScript changes) - consice code comments (it can help to imagine that you're explaining your code to a total stranger) - an examples, if necessary. diff --git a/Makefile b/Makefile index fbbff568..2049b44e 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,7 @@ dev: ALL test: go test github.com/hound-search/hound/... + npm test clean: rm -rf .build node_modules diff --git a/README.md b/README.md index 2ac9ba8f..7b933743 100644 --- a/README.md +++ b/README.md @@ -117,11 +117,21 @@ GOPATH=$(pwd) make -C src/github.com/hound-search/hound ### Testing There are an increasing number of tests in each of the packages in Hound. Please make sure these pass before uploading your Pull Request. You can run the tests with the following command. +To run the entire test suite, use: ``` make test ``` +If you want to just run the JavaScript test suite, use: +``` +npm test +``` + +Any Go files taht end in `_test.go` are assumed to be test files. Tests should live next to the files they cover. [Check out Go's testing docs](https://golang.org/pkg/testing/) for more details. +Any JavaScript file that ends in `.test.js` is automatically run by Jest, our test runner. Tests should live next to the files that they cover. [Check out Jest's docs](https://jestjs.io/docs/en/getting-started) for more details on writing Jest tests. + + ### Working on the web UI Hound includes a web UI that is composed of several files (html, css, javascript, etc.). To make sure hound works seamlessly with the standard Go tools, these resources are all bundled inside of the `houndd` binary. Note that changes to the UI will result in local changes to the `ui/bindata.go` file. You must include these changes in your Pull Request.