File tree 1 file changed +10
-4
lines changed
packages/google-cloud-phishingprotection/samples/test
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 15
15
'use strict' ;
16
16
17
17
const path = require ( 'path' ) ;
18
- const { assert} = require ( 'chai' ) ;
19
18
const { describe, it} = require ( 'mocha' ) ;
20
19
const cp = require ( 'child_process' ) ;
21
20
@@ -24,11 +23,18 @@ const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
24
23
const cwd = path . join ( __dirname , '..' ) ;
25
24
26
25
const PROJECT_ID = '1046198160504' ;
27
- const URI = 'http://testsafebrowsing.appspot. com/s/phishing.html ' ;
26
+ const URI = 'http://example. com' ;
28
27
29
28
describe ( 'Quickstart' , ( ) => {
30
29
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 ( / T h i s s u b m i s s i o n w a s r e c e n t l y r e c e i v e d / ) ) {
34
+ return ;
35
+ } else {
36
+ throw err ;
37
+ }
38
+ }
33
39
} ) ;
34
40
} ) ;
You can’t perform that action at this time.
0 commit comments