Socialify

Folder ..

Viewing googleapis.js
23 lines (23 loc) • 532.0 B

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module.exports = {
  google: {
    drive: jest.fn(() => {
      return {
        files: {
          get: jest.fn(),
          list: jest.fn(() => Promise.resolve({ data: null })),
          create: jest.fn(() => Promise.resolve({ data: null }))
        }
      }
    }),
    auth: {
      OAuth2: jest.fn(() => {
        return {
          on: jest.fn(),
          generateAuthUrl: jest.fn(() => 'https://example.com/google_oauth2'),
          setCredentials: jest.fn(),
          getToken: jest.fn()
        }
      })
    }
  }
}