Skip to content

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

@medero

Description

@medero

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()
    })
  })
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions