Skip to content

Commit 5bea97c

Browse files
jmdobrysofisl
authored andcommitted
Cleanup App Engine samples and re-work tests. (#354)
1 parent 133a505 commit 5bea97c

File tree

3 files changed

+46
-7
lines changed

3 files changed

+46
-7
lines changed

packages/google-cloud-language/samples/README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@ Learning API.
1515
* [Samples](#samples)
1616
* [Analyze](#analyze)
1717
* [Slackbot](#slackbot)
18+
* [Running the tests](#running-the-tests)
1819

1920
## Setup
2021

21-
1. Read [Prerequisites][prereq] and [How to run a sample][run] first.
22-
1. Install dependencies:
22+
1. Read [Prerequisites][prereq] and [How to run a sample][run] first.
23+
1. Install dependencies:
24+
25+
With `npm`:
2326

2427
npm install
2528

29+
With `yarn`:
30+
31+
yarn install
32+
2633
[prereq]: ../README.md#prerequisities
2734
[run]: ../README.md#how-to-run-a-sample
2835

@@ -67,3 +74,18 @@ The example in the [slackbot](./slackbot) subdirectory shows a Slack bot built u
6774
It runs on a Google Container Engine (Kubernetes) cluster, and uses one of the Google Cloud Platform's ML
6875
APIs, the Natural Language (NL) API, to interact in a Slack channel.
6976
See its [README](./slackbot/README.md) for more information.
77+
78+
## Running the tests
79+
80+
1. Set the `GCLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS` environment
81+
variables.
82+
83+
1. Run the tests:
84+
85+
With `npm`:
86+
87+
npm test
88+
89+
With `yarn`:
90+
91+
yarn test

packages/google-cloud-language/samples/package.json

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,34 @@
22
"name": "nodejs-docs-samples-language",
33
"version": "0.0.1",
44
"private": true,
5-
"license": "Apache Version 2.0",
5+
"license": "Apache-2.0",
66
"author": "Google Inc.",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
10+
},
11+
"cloud": {
12+
"requiresKeyFile": true,
13+
"requiresProjectId": true
14+
},
15+
"engines": {
16+
"node": ">=4.3.2"
17+
},
718
"scripts": {
8-
"test": "cd ..; npm run st -- --verbose language/system-test/*.test.js"
19+
"lint": "samples lint \"*.js\" \"system-test/*.js\" \"slackbot/*.js\" \"slackbot/system-test/*.js\"",
20+
"pretest": "npm run lint",
21+
"system-test": "ava -T 20s --verbose system-test/*.test.js",
22+
"test": "npm run system-test"
923
},
1024
"dependencies": {
1125
"@google-cloud/language": "0.10.3",
1226
"@google-cloud/storage": "1.1.0",
1327
"yargs": "7.1.0"
1428
},
15-
"engines": {
16-
"node": ">=4.3.2"
29+
"devDependencies": {
30+
"@google-cloud/nodejs-repo-tools": "1.3.1",
31+
"ava": "0.19.1",
32+
"proxyquire": "1.7.11",
33+
"sinon": "2.1.0"
1734
}
1835
}

packages/google-cloud-language/samples/quickstart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2016, Google, Inc.
2+
* Copyright 2017, Google, Inc.
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
55
* You may obtain a copy of the License at

0 commit comments

Comments
 (0)