Files
sweet/tests/deps.ts
T
Reed von Redwitz 8f3031317b fix: properly prefix all scripts with base path (#2334)
closes https://github.com/denoland/fresh/issues/2326

There was a big misunderstanding on my part -- in particular that a
different server might be listening at the root, so the redirect built
into `context.ts` will never happen. The existing test (as mentioned in
the issue) passes, but only because no one else is listening, and fresh
is able to perform the redirect.

I briefly considered writing a docker container to orchestrate this
properly, but then I didn't want to have docker running in order to run
these tests. (My laptop is old and bad.) So instead the two new tests
very thoroughly assert that scripts included in the html are properly
prefixed with the base path. And yes, they fail if the fix is reverted.

As for the fix itself: I just needed to prepend the asset URL with the
base path.
2024-02-23 13:30:42 +01:00

53 lines
1.6 KiB
TypeScript

/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
export {
assert,
assertEquals,
assertExists,
AssertionError,
assertMatch,
assertNotEquals,
assertNotMatch,
assertRejects,
assertStringIncludes,
assertThrows,
} from "https://deno.land/std@0.216.0/assert/mod.ts";
export { assertSnapshot } from "https://deno.land/std@0.216.0/testing/snapshot.ts";
export {
TextLineStream,
} from "https://deno.land/std@0.216.0/streams/text_line_stream.ts";
export { delay } from "https://deno.land/std@0.216.0/async/delay.ts";
export { retry } from "https://deno.land/std@0.216.0/async/retry.ts";
export {
default as puppeteer,
Page,
} from "https://deno.land/x/puppeteer@16.2.0/mod.ts";
export {
Document,
DOMParser,
HTMLElement,
HTMLMetaElement,
} from "https://esm.sh/linkedom@0.16.8";
export { defineConfig, type Preset } from "https://esm.sh/@twind/core@1.1.3";
export { default as presetTailwind } from "https://esm.sh/@twind/preset-tailwind@1.1.4";
export { copy } from "https://deno.land/std@0.216.0/fs/mod.ts";
export {
basename,
dirname,
extname,
fromFileUrl,
join,
relative,
SEPARATOR,
toFileUrl,
} from "https://deno.land/std@0.216.0/path/mod.ts";
export * as JSONC from "https://deno.land/std@0.216.0/jsonc/mod.ts";
export * as colors from "https://deno.land/std@0.216.0/fmt/colors.ts";
export { STATUS_CODE } from "https://deno.land/std@0.216.0/http/status.ts";
export { stripAnsiCode } from "https://deno.land/std@0.216.0/fmt/colors.ts";
export { Project } from "https://deno.land/x/ts_morph@21.0.1/mod.ts";