commit
This commit is contained in:
parent
be4fd23bcf
commit
0bd53741af
728 changed files with 86573 additions and 0 deletions
30
node_modules/googlethis/test/main.test.js
generated
vendored
Normal file
30
node_modules/googlethis/test/main.test.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
const google = require('..');
|
||||
|
||||
describe('GoogleThis Tests', () => {
|
||||
it('Should search a query', async () => {
|
||||
const search = await google.search('Stephen Hawking');
|
||||
expect(search.results).not.toHaveLength(0);
|
||||
});
|
||||
|
||||
it('Should search using a desktop user agent', async () => {
|
||||
const search = await google.search('Stephen Hawking', { use_mobile_ua: false });
|
||||
expect(search.results).not.toHaveLength(0);
|
||||
});
|
||||
|
||||
it('Should search images', async () => {
|
||||
const search = await google.image('Supermassive Blackhole');
|
||||
expect(search).not.toHaveLength(0);
|
||||
});
|
||||
|
||||
it('Should do reverse image search', async () => {
|
||||
const search = await google.search('https://i.pinimg.com/236x/92/16/d9/9216d9a222ef65eb6eabfff1970180d1.jpg', { ris: true });
|
||||
expect(search.results).not.toHaveLength(0);
|
||||
});
|
||||
|
||||
it('Should retrieve top news', async () => {
|
||||
const news = await google.getTopNews('en', 'AU');
|
||||
expect(news.headline_stories).not.toHaveLength(0);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue