Skip to content

Commit

Permalink
build(samples): update quickstart test (#420)
Browse files Browse the repository at this point in the history
* build(samples): update quickstart test
  • Loading branch information
sofisl committed Oct 13, 2022
1 parent f435765 commit 77bf0c8
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
'use strict';

const path = require('path');
const {assert} = require('chai');
const {describe, it} = require('mocha');
const cp = require('child_process');

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

const PROJECT_ID = '1046198160504';
const URI = 'http://testsafebrowsing.appspot.com/s/phishing.html';
const URI = 'http://example.com';

describe('Quickstart', () => {
it('should run quickstart', async () => {
const stdout = execSync(`node ./quickstart.js ${URI} ${PROJECT_ID}`, {cwd});
assert.include(stdout, 'reported');
try {
execSync(`node ./quickstart.js ${URI} ${PROJECT_ID}`, {cwd});
} catch (err) {
if (err.toString().match(/This submission was recently received/)) {
return;
} else {
throw err;
}
}
});
});

0 comments on commit 77bf0c8

Please sign in to comment.