Skip to content

Commit

Permalink
docs: include section on beta samples in README (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and JustinBeckwith committed May 29, 2019
1 parent 87d7129 commit 1ccb9aa
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 5 deletions.
56 changes: 56 additions & 0 deletions packages/google-cloud-translate/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,62 @@ API is part of the larger Cloud Machine Learning API family. Samples
Before running the samples, make sure you've followed the steps outlined in
[Using the client library](https://github.com/googleapis/nodejs-translate#using-the-client-library).

### Translate V3 Beta Samples

#### Install Dependencies

From the [root directory](https://github.com/googleapis/nodejs-translate) of the client library install the dependencies:

```
npm install
```

Change to the samples directory, link the google-cloud/translate library from the parent, and install its dependencies:

```
cd samples/
npm link ../
npm install
```

#### Run the Tests

To run the tests for the entire sample, run

```
npm test
```

To run the tests for only the translate v3 samples, run

```
npm run test-v3
```

To run the tests for a single translate v3 sample, run this command, substituting FILE_NAME with the name of a valid test file.

```
./node_modules/.bin/mocha test/v3beta1/FILE_NAME
```

For example, to test the `translate_list_language_names_beta` sample, the command would be

```
./node_modules/.bin/mocha test/v3beta1/translate_list_language_names_beta.test.js
```

To run a sample directly, call the file with the `node` command and any required CLI arguments:

```
node v3beta1/FILE_NAME <CLI argument 0> <CLI argument 1>
```

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"

```
node v3beta1/translate_list_codes_beta.js "your_project_id"
```

## Samples


Expand Down
10 changes: 5 additions & 5 deletions packages/google-cloud-translate/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-05-21T11:28:08.403550Z",
"updateTime": "2019-05-29T11:22:38.021811Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.20.0",
"dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec"
"version": "0.21.0",
"dockerImage": "googleapis/artman@sha256:28d4271586772b275cd3bc95cb46bd227a24d3c9048de45dccdb7f3afb0bfba9"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "32a10f69e2c9ce15bba13ab1ff928bacebb25160",
"internalRef": "249058354"
"sha": "fa15c3006e27b87a20c7a9ffbb7bbe4149c61387",
"internalRef": "250401304"
}
},
{
Expand Down

0 comments on commit 1ccb9aa

Please sign in to comment.