-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"trailingComma": "all", | ||
"singleQuote": true | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2020", | ||
"module": "esnext", | ||
"noEmit": true, | ||
"downlevelIteration": true, | ||
"strictNullChecks": true, | ||
"moduleResolution": "node" | ||
}, | ||
"include": ["src/**/*.js"] | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { test } from './ses-ava-test'; | ||
|
||
export default test; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import test from 'ava'; | ||
|
||
const avaTest = test; | ||
|
||
const testWrapper = (title, testFunc) => { | ||
const testFuncWrapper = t => { | ||
harden(t); | ||
let result; | ||
try { | ||
result = testFunc(t); | ||
} catch (err) { | ||
console.log('THROWN from ava test:', err); | ||
throw err; | ||
} | ||
if (Promise.resolve(result) === result) { | ||
return result.then( | ||
v => v, | ||
reason => { | ||
console.log('REJECTED from ava test:', reason); | ||
return result; | ||
}, | ||
); | ||
} else { | ||
return result; | ||
} | ||
}; | ||
return avaTest(title, testFuncWrapper); | ||
}; | ||
harden(testWrapper); | ||
export { testWrapper as test }; |