Skip to content

Commit 870b4bc

Browse files
JustinBeckwithjkwlui
authored andcommitted
test: add a basic system test (#106)
* test: add a basic system test * fixy
1 parent 854b88f commit 870b4bc

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

packages/google-cloud-automl/.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
.coverage
44
.nyc_output
55
docs/
6-
out/
76
build/
8-
system-test/secrets.js
9-
system-test/*key.json
107
*.lock
118
.DS_Store
12-
google-cloud-logging-winston-*.tgz
13-
google-cloud-logging-bunyan-*.tgz
149
package-lock.json

packages/google-cloud-automl/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
"main": "src/index.js",
1212
"files": [
1313
"protos",
14-
"src",
15-
"AUTHORS",
16-
"COPYING"
14+
"src"
1715
],
1816
"keywords": [
1917
"google apis client",
@@ -29,11 +27,9 @@
2927
"Cloud AutoML API"
3028
],
3129
"scripts": {
32-
"test": "npm run cover",
33-
"cover": "nyc --reporter=lcov mocha test/*.js && nyc report",
30+
"test": "nyc mocha",
3431
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
35-
"test-no-cover": "mocha test/*.js --timeout 600000",
36-
"lint": "eslint src/ samples/ system-test/ test/",
32+
"lint": "eslint '**/*.js'",
3733
"docs": "jsdoc -c .jsdoc.js",
3834
"system-test": "mocha system-test/*.js --timeout 600000",
3935
"fix": "eslint '**/*.js' --fix"

packages/google-cloud-automl/system-test/.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
env:
33
mocha: true
44
rules:
5-
node/no-unpublished-require: off
5+
node/no-unsupported-features/es-syntax: off
66
no-console: off

packages/google-cloud-automl/system-test/automl.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,17 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
console.warn('No system tests available 😧');
15+
const automl = require('../src');
16+
const assert = require('assert');
17+
18+
const client = new automl.AutoMlClient();
19+
const location = 'us-central1';
20+
const projectId = process.env.GCLOUD_PROJECT;
21+
22+
describe('automl system tests', () => {
23+
it('should list all datasets', async () => {
24+
const parent = client.locationPath(projectId, location);
25+
const [datasets] = await client.listDatasets({parent});
26+
assert.ok(Array.isArray(datasets));
27+
});
28+
});
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
---
22
env:
33
mocha: true
4-
rules:
5-
node/no-unpublished-require: off

0 commit comments

Comments
 (0)