Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.mockImplementation(() => SynchronousPromise.resolve(options.input || ""));
jest
function runTest(testFn, ctx, value, sync) {
let result = testFn.call(ctx, value);
if (!sync) return Promise.resolve(result);
if (thenable(result)) {
throw new Error(
`Validation test of type: "${
ctx.type
}" returned a Promise during a synchronous validate. ` +
`This test will finish after the validate call has returned`,
);
}
return SynchronousPromise.resolve(result);
}
const _stopOpening = () => {
this.isOpening = false;
return SynchronousPromise.resolve();
};
const _handleError = err => {
const schemaRequestService: SchemaRequestService = url =>
schemas.hasOwnProperty(url)
? SynchronousPromise.resolve(schemas[url])
: SynchronousPromise.reject(
`Schema at url ${url} not supported`
);