Skip to content

Commit 917c672

Browse files
callmehiphopalexander-fenster
authored andcommitted
test(samples): make detect assertions less specific (#433)
* test(samples): make detect assertions less specific * fix license
1 parent 5abb8ec commit 917c672

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

vision/samples/system-test/detect.test.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2017, Google, Inc.
2+
* Copyright 2017 Google LLC
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
@@ -114,26 +114,26 @@ describe(`detect`, () => {
114114
it(`should detect logos in a local file`, async () => {
115115
const output = execSync(`${cmd} logos ${files[9].localPath}`);
116116
assert.match(output, /Logos:/);
117-
assert.match(output, /google/);
117+
assert.match(output, /google/i);
118118
});
119119

120120
it(`should detect logos in a remote file`, async () => {
121121
const output = execSync(`${cmd} logos-gcs ${bucketName} ${files[9].name}`);
122122
assert.match(output, /Logos:/);
123-
assert.match(output, /google/);
123+
assert.match(output, /google/i);
124124
});
125125

126126
it(`should detect properties in a local file`, async () => {
127127
const output = execSync(`${cmd} properties ${files[1].localPath}`);
128-
assert.match(output, /{ color: { red: 69, green: 42, blue: 27/);
128+
assert.match(output, /color: { red: 69, green: 42, blue: 27/);
129129
assert.ok(output.split(`\n`).length > 4, `Multiple colors were detected.`);
130130
});
131131

132132
it(`should detect properties in a remote file`, async () => {
133133
const output = execSync(
134134
`${cmd} properties-gcs ${bucketName} ${files[1].name}`
135135
);
136-
assert.match(output, /{ color: { red: 69, green: 42, blue: 27/);
136+
assert.match(output, /color: { red: 69, green: 42, blue: 27/);
137137
assert.ok(output.split(`\n`).length > 4, `Multiple colors were detected.`);
138138
});
139139

@@ -153,13 +153,13 @@ describe(`detect`, () => {
153153
it(`should detect crop hints in a local file`, async () => {
154154
const output = execSync(`${cmd} crops ${files[2].localPath}`);
155155
assert.match(output, /Crop Hint 0:/);
156-
assert.match(output, /Bound 2: \(280, 43\)/);
156+
assert.match(output, /Bound 2:/);
157157
});
158158

159159
it(`should detect crop hints in a remote file`, async () => {
160160
const output = execSync(`${cmd} crops-gcs ${bucketName} ${files[2].name}`);
161161
assert.match(output, /Crop Hint 0:/);
162-
assert.match(output, /Bound 2: \(280, 43\)/);
162+
assert.match(output, /Bound 2:/);
163163
});
164164

165165
it(`should detect similar web images in a local file`, async () => {
@@ -253,17 +253,13 @@ describe(`detect`, () => {
253253

254254
it(`should detect objects in a local file`, async () => {
255255
const output = execSync(`${cmd} localize-objects ${files[8].localPath}`);
256-
assert.match(output, /Name: Bird/);
257-
assert.match(output, /Name: Duck/);
258256
assert.match(output, /Name: Toy/);
259257
});
260258

261259
it(`should detect objects in a remote file`, async () => {
262260
const output = execSync(
263261
`${cmd} localize-objects-gcs gs://${bucketName}/${files[8].name}`
264262
);
265-
assert.match(output, /Name: Bird/);
266-
assert.match(output, /Name: Duck/);
267263
assert.match(output, /Name: Toy/);
268264
});
269265
});

0 commit comments

Comments
 (0)