Skip to content

Commit 66dcad8

Browse files
authored
Switch to Yarn for CI build. (GoogleCloudPlatform#290)
1 parent 17ea817 commit 66dcad8

File tree

123 files changed

+66404
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+66404
-250
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ logs/
77
*.iml
88
.idea/
99
.nyc_output
10-
yarn.lock

CONTRIBUTING.md

+100
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,106 @@ accept your pull requests.
2929
1. Ensure that your code has an appropriate set of unit tests which all pass.
3030
1. Submit a pull request!
3131

32+
### How to run the tests
33+
34+
1. You must install dependencies at the root of the `nodejs-docs-samples`
35+
directory. You can do so with `yarn` or `npm`:
36+
37+
npm install
38+
39+
or
40+
41+
yarn install
42+
43+
**Note:** Use `npm` *or* `yarn` exclusively, don't mix them.
44+
45+
1. In a terminal, start Redis:
46+
47+
redis-server
48+
49+
1. In another terminal, start `memcached`:
50+
51+
memcached
52+
53+
1. In another terminal, run the unit tests from the root of the project:
54+
55+
npm test
56+
57+
or
58+
59+
yarn test
60+
61+
With code coverage:
62+
63+
npm run cover
64+
65+
or
66+
67+
yarn run cover
68+
69+
1. Then run the system tests from the root of the project:
70+
71+
npm run system-test
72+
73+
or
74+
75+
yarn run system-test
76+
77+
With code coverage:
78+
79+
npm run system-cover
80+
81+
or
82+
83+
yarn run system-cover
84+
85+
1. Or run all the tests at once:
86+
87+
npm run all-test
88+
89+
or
90+
91+
yarn run all-test
92+
93+
With code coverage:
94+
95+
npm run all-cover
96+
97+
or
98+
99+
yarn run all-cover
100+
101+
### Run the tests for a single sample
102+
103+
1. You must install dependencies at the root of the `nodejs-docs-samples`
104+
directory. You can do so with `yarn` or `npm`:
105+
106+
npm install
107+
108+
or
109+
110+
yarn install
111+
112+
1. Change directory to one of the sample folders, e.g. `bigquery`:
113+
114+
cd bigquery/
115+
116+
1. Run the tests (check the `package.json` file):
117+
118+
npm test
119+
120+
or
121+
122+
yarn test
123+
124+
or
125+
126+
npm run system-test
127+
128+
or
129+
130+
yarn run system-test
131+
32132
## Style
33133

34134
Samples in this repository follow the [JavaScript Semi-Standard

README.md

+8-32
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ on Google Cloud Platform.
2121
* [Setup](#setup)
2222
* [Prerequisites](#prerequisites)
2323
* [How to run a sample](#how-to-run-a-sample)
24-
* [How to run the tests](#how-to-run-the-tests)
2524
* [Client libraries](#client-libraries)
2625
* [Google Cloud Node.js client library](#google-cloud-nodejs-client-library)
2726
* [Google API Node.js client library](#google-api-nodejs-client-library)
@@ -144,40 +143,15 @@ on Google Cloud Platform.
144143

145144
npm install
146145

147-
1. Run the sample:
148-
149-
node sample_file.js [args]...
150-
151-
### How to run the tests
152-
153-
1. Read the [Contributing Guide][contrib].
154-
1. In a terminal, start Redis:
155-
156-
redis-server
157-
158-
1. In another terminal, start `memcached`:
159-
160-
memcached
146+
or
161147

162-
1. In another terminal, run the unit tests from the root of the project:
148+
yarn install
163149

164-
npm test
150+
**Note:** Use `npm` *or* `yarn` exclusively, don't mix them.
165151

166-
or with coverage:
167-
168-
npm run coverage
169-
170-
1. Then run the system tests from the root of the project:
171-
172-
npm run system-test
173-
174-
or with coverage:
175-
176-
npm run system-cover
177-
178-
1. Or run all the tests at once with coverage:
152+
1. Run the sample:
179153

180-
npm run all-cover
154+
node sample_file.js [args]...
181155

182156
## Client libraries
183157

@@ -190,7 +164,9 @@ The recommended, idiomatic client for Google Cloud Platform services.
190164

191165
### <img src="https://avatars0.githubusercontent.com/u/1342004?v=3&s=36" alt="Google logo" title="Google" align="left" height="36" width="36" style="margin-top: 9px;"/>Google API Node.js client library
192166

193-
An older Node.js client library for making REST requests to Google APIs.
167+
An older Node.js client library for making REST requests to Google APIs. Use
168+
this for Google Cloud APIs that are not yet supported by the Google Cloud
169+
Node.js client library.
194170

195171
* [Documentation](http://google.github.io/google-api-nodejs-client/)
196172
* [Source code](https://github.com/google/google-api-nodejs-client)

appengine/analytics/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"scripts": {
1212
"start": "node app.js",
13-
"test": "cd ..; npm run t -- appengine/analytics/test/*.test.js"
13+
"test": "cd ../..; npm run t -- appengine/analytics/test/*.test.js"
1414
},
1515
"dependencies": {
1616
"express": "4.14.0",

0 commit comments

Comments
 (0)