Allow ts tests
This commit is contained in:
parent
f782305219
commit
0b292f2e82
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: "ts-jest",
|
||||
// All imported modules in your tests should be mocked automatically
|
||||
// automock: false,
|
||||
|
||||
|
|
|
@ -102,7 +102,11 @@ export async function processObject(object, context, opts) {
|
|||
* @param {object|undefined} [opts] optional - specify some options for processing.
|
||||
* @returns {Promise<string>} The enriched string, all templates should have been replaced if they can be.
|
||||
*/
|
||||
export async function processString(string, context, opts) {
|
||||
export async function processString(
|
||||
string: string,
|
||||
context: object,
|
||||
opts?: { noHelpers: boolean }
|
||||
) {
|
||||
// TODO: carry out any async calls before carrying out async call
|
||||
return processStringSync(string, context, opts)
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ describe("Test that the object processing works correctly", () => {
|
|||
it("should fail gracefully when object passed in has cycles", async () => {
|
||||
let error = null
|
||||
try {
|
||||
const innerObj = { a: "thing {{ a }}" }
|
||||
const innerObj: any = { a: "thing {{ a }}" }
|
||||
innerObj.b = innerObj
|
||||
await processObject(innerObj, { a: 1 })
|
||||
} catch (err) {
|
||||
|
|
Loading…
Reference in New Issue