Skip to content

Instantly share code, notes, and snippets.

@shierro
Created June 28, 2018 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shierro/1145a120fe8b3a93e960730c6a14fa84 to your computer and use it in GitHub Desktop.
Save shierro/1145a120fe8b3a93e960730c6a14fa84 to your computer and use it in GitHub Desktop.
/* 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