Skip to content

Commit 77bf0c8

Browse files
authored
build(samples): update quickstart test (#420)
* build(samples): update quickstart test
1 parent f435765 commit 77bf0c8

File tree

1 file changed

+10
-4
lines changed
  • packages/google-cloud-phishingprotection/samples/test

1 file changed

+10
-4
lines changed

packages/google-cloud-phishingprotection/samples/test/quickstart.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
'use strict';
1616

1717
const path = require('path');
18-
const {assert} = require('chai');
1918
const {describe, it} = require('mocha');
2019
const cp = require('child_process');
2120

@@ -24,11 +23,18 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
2423
const cwd = path.join(__dirname, '..');
2524

2625
const PROJECT_ID = '1046198160504';
27-
const URI = 'http://testsafebrowsing.appspot.com/s/phishing.html';
26+
const URI = 'http://example.com';
2827

2928
describe('Quickstart', () => {
3029
it('should run quickstart', async () => {
31-
const stdout = execSync(`node ./quickstart.js ${URI} ${PROJECT_ID}`, {cwd});
32-
assert.include(stdout, 'reported');
30+
try {
31+
execSync(`node ./quickstart.js ${URI} ${PROJECT_ID}`, {cwd});
32+
} catch (err) {
33+
if (err.toString().match(/This submission was recently received/)) {
34+
return;
35+
} else {
36+
throw err;
37+
}
38+
}
3339
});
3440
});

0 commit comments

Comments
 (0)