Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/LocationApiSpec.js test failure: google_id changed from 200635 to 1026201 #22

Open
medero opened this issue Aug 13, 2024 · 3 comments · May be fixed by #23
Open

test/LocationApiSpec.js test failure: google_id changed from 200635 to 1026201 #22

medero opened this issue Aug 13, 2024 · 3 comments · May be fixed by #23

Comments

@medero
Copy link

medero commented Aug 13, 2024

To replicate

npm install
export API_KEY=(key)
npm test

  21 passing (1s)
  1 failing

  1) Location API
       example:
     Uncaught Error: expect(received).toEqual(expected) // deep equality

Expected: 200635
Received: 1026201

Location API
1) example

I actually experienced this when refactoring PHP so switched to nodejs to sanity check the expected number and I think the 'Austin' search here changed due to possible updates?

const expect = require('expect');
const serpapi = require('../lib/main');

describe('Location API', () => {
  it('example', (done) => {
    var search = new serpapi.GoogleSearch()
    search.location("Austin", 3, (data) => {
      //console.log(data)
      expect(data[0].google_id).toEqual(200635)
      expect(data.length).toEqual(3)
      done()
    })
  })
})
@ilyazub
Copy link

ilyazub commented Aug 15, 2024

@kagermanov27 Can you double-check whether this Location API test failure is related to our recent locations update?

@kagermanov27
Copy link

@medero We have made an update to our Locations API and it is now more recent. You can refer to:

2024-06-19 CSV

for the latest update. Google has updated the Google ID (Criteria ID) for Austin,Texas,United States with 1026201.

@ilyazub
Copy link

ilyazub commented Aug 23, 2024

@kagermanov27 Our test/LocationApiSpec.js is failing because of the Locations API update. I guess that was the issue.

@ilyazub ilyazub reopened this Aug 23, 2024
@ilyazub ilyazub changed the title npm test assertion: Location API expected 200635 received 1026201 test/LocationApiSpec.js test failure: Location API expected 200635 received 1026201 Aug 23, 2024
@ilyazub ilyazub changed the title test/LocationApiSpec.js test failure: Location API expected 200635 received 1026201 test/LocationApiSpec.js test failure: google_id changed from 200635 to 1026201 Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants