Skip to content

Commit 66472e8

Browse files
jmdobryAce Nassri
authored andcommitted
Cleanup App Engine samples and re-work tests. (#354)
1 parent 434cbff commit 66472e8

3 files changed

Lines changed: 46 additions & 7 deletions

File tree

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@ recognition technologies into developer applications.
1212
* [Setup](#setup)
1313
* [Samples](#samples)
1414
* [Recognize](#recognize)
15+
* [Running the tests](#running-the-tests)
1516

1617
## Setup
1718

18-
1. Read [Prerequisites][prereq] and [How to run a sample][run] first.
19-
1. Install dependencies:
19+
1. Read [Prerequisites][prereq] and [How to run a sample][run] first.
20+
1. Install dependencies:
21+
22+
With `npm`:
2023

2124
npm install
2225

26+
With `yarn`:
27+
28+
yarn install
29+
2330
[prereq]: ../README.md#prerequisities
2431
[run]: ../README.md#how-to-run-a-sample
2532

@@ -61,3 +68,18 @@ For more information, see https://cloud.google.com/speech/docs
6168

6269
[recognize_docs]: https://cloud.google.com/speech/docs
6370
[recognize_code]: recognize.js
71+
72+
## Running the tests
73+
74+
1. Set the `GCLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS` environment
75+
variables.
76+
77+
1. Run the tests:
78+
79+
With `npm`:
80+
81+
npm test
82+
83+
With `yarn`:
84+
85+
yarn test

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,35 @@
22
"name": "nodejs-docs-samples-speech",
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 speech/system-test/*.test.js"
19+
"lint": "samples lint",
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/speech": "0.9.0",
1226
"@google-cloud/storage": "1.0.0",
1327
"node-record-lpcm16": "0.3.0",
1428
"yargs": "7.0.2"
1529
},
16-
"engines": {
17-
"node": ">=4.3.2"
30+
"devDependencies": {
31+
"@google-cloud/nodejs-repo-tools": "1.3.1",
32+
"ava": "0.19.1",
33+
"proxyquire": "1.7.11",
34+
"sinon": "2.1.0"
1835
}
1936
}

packages/google-cloud-speech/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)