[ci] format

This commit is contained in:
matthewp 2022-10-07 13:38:38 +00:00 committed by fredkbot
parent 4393bd6710
commit 358ffb541d
3 changed files with 20 additions and 17 deletions

View file

@ -1,6 +1,6 @@
import { StartServerCallback, runBuildAndStartApp, defaultTestPermissions } from './helpers.ts';
import { DOMParser } from "https://deno.land/x/deno_dom@v0.1.35-alpha/deno-dom-wasm.ts";
import { assert, assertEquals } from "https://deno.land/std@0.158.0/testing/asserts.ts";
import { DOMParser } from 'https://deno.land/x/deno_dom@v0.1.35-alpha/deno-dom-wasm.ts';
import { assert, assertEquals } from 'https://deno.land/std@0.158.0/testing/asserts.ts';
async function startApp(cb: StartServerCallback) {
await runBuildAndStartApp('./fixtures/basics/', cb);
@ -30,7 +30,7 @@ Deno.test({
});
},
sanitizeResources: false,
sanitizeOps: false
sanitizeOps: false,
});
Deno.test({
@ -38,7 +38,7 @@ Deno.test({
permissions: defaultTestPermissions,
async fn() {
await startApp(async (baseUrl: URL) => {
const resp = await fetch(new URL("this-does-not-exist", baseUrl));
const resp = await fetch(new URL('this-does-not-exist', baseUrl));
assertEquals(resp.status, 404);
const html = await resp.text();
@ -50,7 +50,7 @@ Deno.test({
});
},
sanitizeResources: false,
sanitizeOps: false
sanitizeOps: false,
});
Deno.test({
@ -73,7 +73,7 @@ Deno.test({
});
},
sanitizeResources: false,
sanitizeOps: false
sanitizeOps: false,
});
Deno.test({
@ -90,7 +90,7 @@ Deno.test({
});
},
sanitizeResources: false,
sanitizeOps: false
sanitizeOps: false,
});
Deno.test({
@ -107,7 +107,7 @@ Deno.test({
});
},
sanitizeResources: false,
sanitizeOps: false
sanitizeOps: false,
});
Deno.test({
@ -124,5 +124,5 @@ Deno.test({
});
},
sanitizeResources: false,
sanitizeOps: false
sanitizeOps: false,
});

View file

@ -1,6 +1,6 @@
import { DOMParser } from "https://deno.land/x/deno_dom@v0.1.35-alpha/deno-dom-wasm.ts";
import { assert, assertEquals } from "https://deno.land/std@0.158.0/testing/asserts.ts";
import { StartServerCallback, runBuildAndStartAppFromSubprocess } from "./helpers.ts";
import { DOMParser } from 'https://deno.land/x/deno_dom@v0.1.35-alpha/deno-dom-wasm.ts';
import { assert, assertEquals } from 'https://deno.land/std@0.158.0/testing/asserts.ts';
import { StartServerCallback, runBuildAndStartAppFromSubprocess } from './helpers.ts';
async function startApp(cb: StartServerCallback) {
await runBuildAndStartAppFromSubprocess('./fixtures/dynimport/', cb);

View file

@ -1,15 +1,15 @@
import { fromFileUrl } from 'https://deno.land/std@0.110.0/path/mod.ts';
import { assert } from "https://deno.land/std@0.158.0/testing/asserts.ts";
import { assert } from 'https://deno.land/std@0.158.0/testing/asserts.ts';
import { readableStreamFromReader } from 'https://deno.land/std@0.142.0/streams/conversion.ts';
const dir = new URL('./', import.meta.url);
const defaultURL = new URL("http://localhost:8085/");
const defaultURL = new URL('http://localhost:8085/');
export const defaultTestPermissions: Deno.PermissionOptions = {
read: true,
net: true,
run: true,
env: true
env: true,
};
export declare type StartServerCallback = (url: URL) => Promise<void>;
@ -22,7 +22,7 @@ export async function runBuild(fixturePath: string) {
});
try {
const status = await proc.status();
assert(status.success)
assert(status.success);
} finally {
proc.close();
}
@ -72,7 +72,10 @@ export async function runBuildAndStartApp(fixturePath: string, cb: StartServerCa
}
}
export async function runBuildAndStartAppFromSubprocess(fixturePath: string, cb: StartServerCallback) {
export async function runBuildAndStartAppFromSubprocess(
fixturePath: string,
cb: StartServerCallback
) {
const url = new URL(fixturePath, dir);
await runBuild(fixturePath);