MCPcopy Create free account
hub / github.com/codecombat/codecombat / fakeAPI

Method fakeAPI

app/core/social-handlers/GPlusHandler.js:38–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 token () { return (this.accessToken != null ? this.accessToken.access_token : undefined) }
37
38 fakeAPI () {
39 // eslint-disable-function n/no-callback-literal
40 window.gapi = {
41 client: {
42 init () {},
43 load (api, version, cb) { return cb() },
44 people: {
45 people: {
46 get () {
47 return {
48 execute (cb) {
49 return cb({ // eslint-disable-line n/no-callback-literal
50 resourceName: 'people/abcd',
51 names: [{
52 givenName: 'Mr',
53 familyName: 'Bean'
54 }],
55 emailAddresses: [{ value: 'some@email.com' }]
56 })
57 }
58 }
59 }
60 }
61 }
62 },
63
64 auth2: {
65 authorize (opts, cb) {
66 return cb({ access_token: '1234' }) // eslint-disable-line n/no-callback-literal
67 }
68 }
69 }
70
71 window.google = {
72 accounts: {
73 id: {
74 initialize () {},
75 renderButton () {},
76 prompt () {}
77 }
78 }
79 }
80
81 this.startedLoading = true
82 this.apiLoaded = true
83 }
84
85 fakeConnect () {
86 this.accessToken = { access_token: '1234' }

Calls

no outgoing calls

Tested by

no test coverage detected