mirror of https://github.com/01-edu/public.git
nprimo
2 years ago
committed by
Niccolò Primo
1 changed files with 18 additions and 5 deletions
@ -1,6 +1,19 @@
|
||||
import keptPromise
|
||||
export const tests = [] |
||||
|
||||
const getImportantInfo = _ => |
||||
new Promise(resolve => { |
||||
setTimeout(_ => resolve(Math.round(Math.random() * 10)), 1000) |
||||
}) |
||||
const testZero = async _ => { |
||||
return (await processInfo(_ => new Promise(resolve => resolve(0)))) === 'Ok!' |
||||
} |
||||
|
||||
const testOddNumber = async _ => { |
||||
return ( |
||||
(await processInfo(_ => new Promise(resolve => resolve(1)))) === 'Error!' |
||||
) |
||||
} |
||||
|
||||
const testEvenNumber = async _ => { |
||||
return (await processInfo(_ => new Promise(resolve => resolve(4)))) === 'Ok!' |
||||
} |
||||
|
||||
tests.push(testZero, testOddNumber, testEvenNumber) |
||||
|
||||
Object.freeze(tests) |
||||
|
Loading…
Reference in new issue