Skip to content

Commit

Permalink
Cleanup App Engine samples and re-work tests. (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry authored and Ace Nassri committed Apr 24, 2017
1 parent 6ca1543 commit d575e4e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 7 deletions.
26 changes: 24 additions & 2 deletions packages/google-cloud-language/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@ Learning API.
* [Samples](#samples)
* [Analyze](#analyze)
* [Slackbot](#slackbot)
* [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

Expand Down Expand Up @@ -67,3 +74,18 @@ The example in the [slackbot](./slackbot) subdirectory shows a Slack bot built u
It runs on a Google Container Engine (Kubernetes) cluster, and uses one of the Google Cloud Platform's ML
APIs, the Natural Language (NL) API, to interact in a Slack channel.
See its [README](./slackbot/README.md) for more information.

## 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
25 changes: 21 additions & 4 deletions packages/google-cloud-language/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,34 @@
"name": "nodejs-docs-samples-language",
"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 language/system-test/*.test.js"
"lint": "samples lint \"*.js\" \"system-test/*.js\" \"slackbot/*.js\" \"slackbot/system-test/*.js\"",
"pretest": "npm run lint",
"system-test": "ava -T 20s --verbose system-test/*.test.js",
"test": "npm run system-test"
},
"dependencies": {
"@google-cloud/language": "0.10.3",
"@google-cloud/storage": "1.1.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"
}
}
2 changes: 1 addition & 1 deletion packages/google-cloud-language/samples/quickstart.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016, Google, Inc.
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down

0 comments on commit d575e4e

Please sign in to comment.