Browse Source

feat(broken-promise): add test

pull/1996/head
davhojt 2 years ago committed by Dav Hojt
parent
commit
cd049bcb92
  1. 25
      js/tests/broken-promise_test.js

25
js/tests/broken-promise_test.js

@ -0,0 +1,25 @@
export const tests = []
const testOne = async () => {
return (await processInfo(() => new Promise(resolve => resolve(1)))) === 2
}
const testFifteen = async () => {
return (await processInfo(() => new Promise(resolve => resolve(15)))) === 30
}
const testRejectNoNumbers = async () => {
return (
(await processInfo(() => new Promise((resolve, reject) => reject("No numbers")))) === "Error: No numbers"
)
}
const testRejectNumberless = async () => {
return (
(await processInfo(() => new Promise((resolve, reject) => reject("Numberless")))) === "Error: Numberless"
)
}
tests.push(testOne, testFifteen, testRejectNoNumbers, testRejectNumberless)
Object.freeze(tests)
Loading…
Cancel
Save