Skip to content

Commit 1ccb9aa

Browse files
yoshi-automationJustinBeckwith
authored andcommitted
docs: include section on beta samples in README (#283)
1 parent 87d7129 commit 1ccb9aa

File tree

2 files changed

+61
-5
lines changed

2 files changed

+61
-5
lines changed

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

+56
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,62 @@ API is part of the larger Cloud Machine Learning API family. Samples
2525
Before running the samples, make sure you've followed the steps outlined in
2626
[Using the client library](https://github.com/googleapis/nodejs-translate#using-the-client-library).
2727

28+
### Translate V3 Beta Samples
29+
30+
#### Install Dependencies
31+
32+
From the [root directory](https://github.com/googleapis/nodejs-translate) of the client library install the dependencies:
33+
34+
```
35+
npm install
36+
```
37+
38+
Change to the samples directory, link the google-cloud/translate library from the parent, and install its dependencies:
39+
40+
```
41+
cd samples/
42+
npm link ../
43+
npm install
44+
```
45+
46+
#### Run the Tests
47+
48+
To run the tests for the entire sample, run
49+
50+
```
51+
npm test
52+
```
53+
54+
To run the tests for only the translate v3 samples, run
55+
56+
```
57+
npm run test-v3
58+
```
59+
60+
To run the tests for a single translate v3 sample, run this command, substituting FILE_NAME with the name of a valid test file.
61+
62+
```
63+
./node_modules/.bin/mocha test/v3beta1/FILE_NAME
64+
```
65+
66+
For example, to test the `translate_list_language_names_beta` sample, the command would be
67+
68+
```
69+
./node_modules/.bin/mocha test/v3beta1/translate_list_language_names_beta.test.js
70+
```
71+
72+
To run a sample directly, call the file with the `node` command and any required CLI arguments:
73+
74+
```
75+
node v3beta1/FILE_NAME <CLI argument 0> <CLI argument 1>
76+
```
77+
78+
For example, to run the `translate_list_codes_beta` sample, you would run the following command, substituting your project ID in place of "your_project_id"
79+
80+
```
81+
node v3beta1/translate_list_codes_beta.js "your_project_id"
82+
```
83+
2884
## Samples
2985

3086

packages/google-cloud-translate/synth.metadata

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-05-21T11:28:08.403550Z",
2+
"updateTime": "2019-05-29T11:22:38.021811Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.20.0",
8-
"dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec"
7+
"version": "0.21.0",
8+
"dockerImage": "googleapis/artman@sha256:28d4271586772b275cd3bc95cb46bd227a24d3c9048de45dccdb7f3afb0bfba9"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160",
16-
"internalRef": "249058354"
15+
"sha": "fa15c3006e27b87a20c7a9ffbb7bbe4149c61387",
16+
"internalRef": "250401304"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)