Use dprint for internal formatting (#6682)

This commit is contained in:
David Sherret 2020-07-14 15:24:17 -04:00 committed by GitHub
parent 9eca71caa1
commit cde4dbb351
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
378 changed files with 3116 additions and 3121 deletions

View file

@ -52,7 +52,7 @@ After:
- completed: ${post.opsCompletedAsync}
Make sure to await all promises returned from Deno APIs before
finishing test case.`
finishing test case.`,
);
};
}
@ -61,7 +61,7 @@ finishing test case.`
// the test case does not "leak" resources - ie. resource table after
// the test has exactly the same contents as before the test.
function assertResources(
fn: () => void | Promise<void>
fn: () => void | Promise<void>,
): () => void | Promise<void> {
return async function resourceSanitizer(): Promise<void> {
const pre = resources();
@ -97,7 +97,7 @@ export function test(name: string, fn: () => void | Promise<void>): void;
// creates a new object with "name" and "fn" fields.
export function test(
t: string | TestDefinition,
fn?: () => void | Promise<void>
fn?: () => void | Promise<void>,
): void {
let testDef: TestDefinition;
const defaults = {
@ -220,7 +220,7 @@ function reportToConsole(message: TestMessage): void {
`${message.end.passed} passed; ${message.end.failed} failed; ` +
`${message.end.ignored} ignored; ${message.end.measured} measured; ` +
`${message.end.filtered} filtered out ` +
`${formatDuration(message.end.duration)}\n`
`${formatDuration(message.end.duration)}\n`,
);
if (message.end.usedOnly && message.end.failed == 0) {
@ -247,7 +247,7 @@ class TestRunner {
constructor(
tests: TestDefinition[],
public filterFn: (def: TestDefinition) => boolean,
public failFast: boolean
public failFast: boolean,
) {
const onlyTests = tests.filter(({ only }) => only);
this.#usedOnly = onlyTests.length > 0;
@ -300,7 +300,7 @@ class TestRunner {
function createFilterFn(
filter: undefined | string | RegExp,
skip: undefined | string | RegExp
skip: undefined | string | RegExp,
): (def: TestDefinition) => boolean {
return (def: TestDefinition): boolean => {
let passes = true;