From 43374352023f688755b53d39cc28a384e68dabfe Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Mon, 24 Apr 2017 14:40:11 -0700 Subject: [PATCH] Cleanup App Engine samples and re-work tests. (#354) --- packages/google-cloud-dns/samples/README.md | 28 +++++++++++++++++-- .../google-cloud-dns/samples/package.json | 27 ++++++++++++++---- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-dns/samples/README.md b/packages/google-cloud-dns/samples/README.md index 34ba9a67660..206b7ea9d21 100644 --- a/packages/google-cloud-dns/samples/README.md +++ b/packages/google-cloud-dns/samples/README.md @@ -14,14 +14,21 @@ anywhere in the world. Read more about [Google Cloud DNS][dns_docs]. * [Setup](#setup) * [Samples](#samples) * [Zones](#zones) +* [Running the tests](#running-the-tests) ## Setup -1. Read [Prerequisites][prereq] and [How to run a sample][run] first. -1. Install dependencies: +1. Read [Prerequisites][prereq] and [How to run a sample][run] first. +1. Install dependencies: + + With `npm`: npm install + With `yarn`: + + yarn install + [prereq]: ../README.md#prerequisities [run]: ../README.md#how-to-run-a-sample @@ -41,10 +48,25 @@ Options: --help Show help [boolean] Examples: - node zones list Lists all zones in the current project. + node zones.js list Lists all zones in the current project. For more information, see https://cloud.google.com/dns/docs ``` [zones_docs]: https://cloud.google.com/dns/docs [zones_code]: zones.js + +## Running the tests + +1. Set the `GCLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS` environment + variables. + +1. Run the tests: + + With `npm`: + + npm test + + With `yarn`: + + yarn test diff --git a/packages/google-cloud-dns/samples/package.json b/packages/google-cloud-dns/samples/package.json index 7e4ba13317a..14793f2b48a 100644 --- a/packages/google-cloud-dns/samples/package.json +++ b/packages/google-cloud-dns/samples/package.json @@ -2,16 +2,33 @@ "name": "nodejs-docs-samples-dns", "version": "0.0.1", "private": true, - "license": "Apache Version 2.0", + "license": "Apache-2.0", "author": "Google Inc.", + "repository": { + "type": "git", + "url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git" + }, + "cloud": { + "requiresKeyFile": true, + "requiresProjectId": true + }, + "engines": { + "node": ">=4.3.2" + }, "scripts": { - "test": "cd ..; npm run st -- --verbose dns/system-test/*.test.js" + "lint": "samples lint", + "pretest": "npm run lint", + "system-test": "ava -T 1m --verbose system-test/*.test.js", + "test": "npm run system-test" }, "dependencies": { "@google-cloud/dns": "0.5.0", - "yargs": "6.6.0" + "yargs": "7.1.0" }, - "engines": { - "node": ">=4.3.2" + "devDependencies": { + "@google-cloud/nodejs-repo-tools": "1.3.1", + "ava": "0.19.1", + "proxyquire": "1.7.11", + "sinon": "2.1.0" } }