Created
June 28, 2018 13:35
-
-
Save shierro/1145a120fe8b3a93e960730c6a14fa84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable */ | |
const VerifySingleton = { | |
sleep (ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
}, | |
async testFunc() { | |
return Promise.reject({ | |
statusCode: 500, | |
errorCode, | |
}) | |
await this.sleep(1000); | |
console.log(123) | |
await this.sleep(1000); | |
console.log(321) | |
return { cookie: 'heres some cookie!' }; | |
} | |
} | |
class VerifyFactory { | |
static staticSleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
static async staticTestFunc() { | |
await this.sleep(1000); | |
console.log(123) | |
await this.sleep(1000); | |
console.log(321) | |
return { cookie: 'heres some cookie!' }; | |
} | |
async testFunc() { | |
await this.sleep(1000); | |
console.log(123) | |
await this.sleep(1000); | |
console.log(321) | |
return { cookie: 'heres some cookie!' }; | |
} | |
} | |
module.exports = { | |
VerifySingleton, | |
VerifyFactory, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment