tests: fix leaks, macOS hangs and utility cleanups (#2897)
1. Upgrades `@astral/astral` 2. Fixes test leaks 3. Fixes `@fresh/init` test hangs 4. Simplifies and cleans up test utilities
This commit is contained in:
@@ -65,7 +65,7 @@
|
||||
"@std/semver": "jsr:@std/semver@1",
|
||||
"@std/streams": "jsr:@std/streams@1",
|
||||
|
||||
"@astral/astral": "jsr:@astral/astral@^0.4.6",
|
||||
"@astral/astral": "jsr:@astral/astral@^0.5.2",
|
||||
"@marvinh-test/fresh-island": "jsr:@marvinh-test/fresh-island@^0.0.1",
|
||||
"linkedom": "npm:linkedom@^0.16.11",
|
||||
"@std/async": "jsr:@std/async@1",
|
||||
|
||||
@@ -1,39 +1,61 @@
|
||||
{
|
||||
"version": "5",
|
||||
"specifiers": {
|
||||
"jsr:@astral/astral@~0.4.6": "0.4.9",
|
||||
"jsr:@astral/astral@~0.5.2": "0.5.2",
|
||||
"jsr:@deno-library/progress@^1.5.1": "1.5.1",
|
||||
"jsr:@deno/cache-dir@0.14": "0.14.0",
|
||||
"jsr:@deno/doc@0.172": "0.172.0",
|
||||
"jsr:@deno/otel@*": "0.0.2",
|
||||
"jsr:@fresh/core@^2.0.0-alpha.26": "2.0.0-alpha.29",
|
||||
"jsr:@luca/esbuild-deno-loader@0.11": "0.11.1",
|
||||
"jsr:@marvinh-test/fresh-island@*": "0.0.1",
|
||||
"jsr:@marvinh-test/fresh-island@^0.0.1": "0.0.1",
|
||||
"jsr:@std/assert@^1.0.12": "1.0.13",
|
||||
"jsr:@std/async@1": "1.0.12",
|
||||
"jsr:@std/bytes@^1.0.2": "1.0.5",
|
||||
"jsr:@std/bytes@^1.0.5": "1.0.5",
|
||||
"jsr:@std/cli@^1.0.17": "1.0.17",
|
||||
"jsr:@std/collections@^1.0.11": "1.0.11",
|
||||
"jsr:@std/crypto@1": "1.0.4",
|
||||
"jsr:@std/data-structures@^1.0.6": "1.0.7",
|
||||
"jsr:@std/datetime@~0.225.2": "0.225.4",
|
||||
"jsr:@std/encoding@1": "1.0.10",
|
||||
"jsr:@std/encoding@^1.0.10": "1.0.10",
|
||||
"jsr:@std/encoding@^1.0.5": "1.0.10",
|
||||
"jsr:@std/expect@1": "1.0.15",
|
||||
"jsr:@std/fmt@1": "1.0.7",
|
||||
"jsr:@std/fmt@1.0.3": "1.0.3",
|
||||
"jsr:@std/fmt@^1.0.3": "1.0.7",
|
||||
"jsr:@std/fmt@^1.0.7": "1.0.7",
|
||||
"jsr:@std/front-matter@^1.0.5": "1.0.9",
|
||||
"jsr:@std/fs@1": "1.0.17",
|
||||
"jsr:@std/fs@^1.0.16": "1.0.17",
|
||||
"jsr:@std/fs@^1.0.6": "1.0.17",
|
||||
"jsr:@std/html@1": "1.0.3",
|
||||
"jsr:@std/html@^1.0.3": "1.0.3",
|
||||
"jsr:@std/http@^1.0.15": "1.0.15",
|
||||
"jsr:@std/internal@^1.0.6": "1.0.6",
|
||||
"jsr:@std/io@0.225": "0.225.0",
|
||||
"jsr:@std/io@0.225.0": "0.225.0",
|
||||
"jsr:@std/json@^1.0.2": "1.0.2",
|
||||
"jsr:@std/jsonc@1": "1.0.2",
|
||||
"jsr:@std/media-types@1": "1.1.0",
|
||||
"jsr:@std/media-types@^1.1.0": "1.1.0",
|
||||
"jsr:@std/net@^1.0.4": "1.0.4",
|
||||
"jsr:@std/path@1": "1.0.9",
|
||||
"jsr:@std/path@^1.0.6": "1.0.9",
|
||||
"jsr:@std/path@^1.0.8": "1.0.9",
|
||||
"jsr:@std/path@^1.0.9": "1.0.9",
|
||||
"jsr:@std/semver@1": "1.0.5",
|
||||
"jsr:@std/streams@1": "1.0.9",
|
||||
"jsr:@std/streams@^1.0.9": "1.0.9",
|
||||
"jsr:@std/testing@1": "1.0.11",
|
||||
"jsr:@std/toml@^1.0.3": "1.0.5",
|
||||
"jsr:@std/yaml@^1.0.5": "1.0.6",
|
||||
"jsr:@zip-js/zip-js@^2.7.52": "2.7.60",
|
||||
"npm:@opentelemetry/api@1": "1.9.0",
|
||||
"npm:@opentelemetry/api@^1.9.0": "1.9.0",
|
||||
"npm:@opentelemetry/sdk-trace-base@1": "1.30.1_@opentelemetry+api@1.9.0",
|
||||
"npm:@preact/signals@^1.2.3": "1.3.2_preact@10.26.5",
|
||||
"npm:@preact/signals@^1.3.0": "1.3.2_preact@10.26.5",
|
||||
"npm:@types/node@*": "22.12.0",
|
||||
@@ -55,8 +77,8 @@
|
||||
"npm:ts-morph@22": "22.0.0"
|
||||
},
|
||||
"jsr": {
|
||||
"@astral/astral@0.4.9": {
|
||||
"integrity": "8e62a10f6f43c0155647c2564fa2e6c1186e74285272b30d8bae4294326435ff",
|
||||
"@astral/astral@0.5.2": {
|
||||
"integrity": "dc4b7e0ea5d8186fcd9e33e2c54e62913d7eb99d5a2d4f987b1c5399d8e295de",
|
||||
"dependencies": [
|
||||
"jsr:@deno-library/progress",
|
||||
"jsr:@std/async",
|
||||
@@ -69,13 +91,56 @@
|
||||
"integrity": "966611826b8bb27baae73ab1c4fa4317cd4edd2abb99750cd6f8488d22d5b121",
|
||||
"dependencies": [
|
||||
"jsr:@std/fmt@1.0.3",
|
||||
"jsr:@std/io"
|
||||
"jsr:@std/io@0.225.0"
|
||||
]
|
||||
},
|
||||
"@deno/cache-dir@0.14.0": {
|
||||
"integrity": "729f0b68e7fc96443c09c2c544b830ca70897bdd5168598446d752f7a4c731ad",
|
||||
"dependencies": [
|
||||
"jsr:@std/fmt@^1.0.3",
|
||||
"jsr:@std/fs@^1.0.6",
|
||||
"jsr:@std/io@0.225",
|
||||
"jsr:@std/path@^1.0.8"
|
||||
]
|
||||
},
|
||||
"@deno/doc@0.172.0": {
|
||||
"integrity": "72a68ed533576a06feb930a84784ad9ba6d83ca9d581fc734d498c58e32b7cf5",
|
||||
"dependencies": [
|
||||
"jsr:@deno/cache-dir"
|
||||
]
|
||||
},
|
||||
"@deno/otel@0.0.2": {
|
||||
"integrity": "4ef61b7eb1c4063f8224d66fc43f25e428a566d2e18785d0dc67bb70a318f0ff",
|
||||
"dependencies": [
|
||||
"npm:@opentelemetry/api@1",
|
||||
"npm:@opentelemetry/sdk-trace-base"
|
||||
]
|
||||
},
|
||||
"@fresh/core@2.0.0-alpha.29": {
|
||||
"integrity": "5374a478c2d407da2a84a9802e00da2305de2945b0934e6a7b24a989a7b82e0f",
|
||||
"dependencies": [
|
||||
"jsr:@luca/esbuild-deno-loader",
|
||||
"jsr:@std/crypto",
|
||||
"jsr:@std/datetime",
|
||||
"jsr:@std/encoding@1",
|
||||
"jsr:@std/fmt@1",
|
||||
"jsr:@std/fs@1",
|
||||
"jsr:@std/html@1",
|
||||
"jsr:@std/jsonc",
|
||||
"jsr:@std/media-types@1",
|
||||
"jsr:@std/path@1",
|
||||
"jsr:@std/semver",
|
||||
"npm:@opentelemetry/api@^1.9.0",
|
||||
"npm:esbuild",
|
||||
"npm:esbuild-wasm",
|
||||
"npm:preact-render-to-string",
|
||||
"npm:preact@^10.25.1"
|
||||
]
|
||||
},
|
||||
"@luca/esbuild-deno-loader@0.11.1": {
|
||||
"integrity": "dc020d16d75b591f679f6b9288b10f38bdb4f24345edb2f5732affa1d9885267",
|
||||
"dependencies": [
|
||||
"jsr:@std/bytes",
|
||||
"jsr:@std/bytes@^1.0.2",
|
||||
"jsr:@std/encoding@^1.0.5",
|
||||
"jsr:@std/path@^1.0.6"
|
||||
]
|
||||
@@ -100,9 +165,18 @@
|
||||
"@std/bytes@1.0.5": {
|
||||
"integrity": "4465dd739d7963d964c809202ebea6d5c6b8e3829ef25c6a224290fbb8a1021e"
|
||||
},
|
||||
"@std/cli@1.0.17": {
|
||||
"integrity": "e15b9abe629e17be90cc6216327f03a29eae613365f1353837fa749aad29ce7b"
|
||||
},
|
||||
"@std/collections@1.0.11": {
|
||||
"integrity": "2f62cf9587484b1fff364f6c3e1f83478eea53dbb6faed6ffeda92ddb6b172f0"
|
||||
},
|
||||
"@std/crypto@1.0.4": {
|
||||
"integrity": "cee245c453bd5366207f4d8aa25ea3e9c86cecad2be3fefcaa6cb17203d79340"
|
||||
},
|
||||
"@std/data-structures@1.0.7": {
|
||||
"integrity": "16932d2c8d281f65eaaa2209af2473209881e33b1ced54cd1b015e7b4cdbb0d2"
|
||||
},
|
||||
"@std/datetime@0.225.4": {
|
||||
"integrity": "682bc21738b941a4ed1465be6da01704e8010a3a6d9b615de9458202b84e00ec"
|
||||
},
|
||||
@@ -122,6 +196,13 @@
|
||||
"@std/fmt@1.0.7": {
|
||||
"integrity": "2a727c043d8df62cd0b819b3fb709b64dd622e42c3b1bb817ea7e6cc606360fb"
|
||||
},
|
||||
"@std/front-matter@1.0.9": {
|
||||
"integrity": "ee6201d06674cbef137dda2252f62477450b48249e7d8d9ab57a30f85ff6f051",
|
||||
"dependencies": [
|
||||
"jsr:@std/toml",
|
||||
"jsr:@std/yaml"
|
||||
]
|
||||
},
|
||||
"@std/fs@1.0.17": {
|
||||
"integrity": "1c00c632677c1158988ef7a004cb16137f870aafdb8163b9dce86ec652f3952b",
|
||||
"dependencies": [
|
||||
@@ -132,13 +213,26 @@
|
||||
"integrity": "7a0ac35e050431fb49d44e61c8b8aac1ebd55937e0dc9ec6409aa4bab39a7988"
|
||||
},
|
||||
"@std/http@1.0.15": {
|
||||
"integrity": "435a4934b4e196e82a8233f724da525f7b7112f3566502f28815e94764c19159"
|
||||
"integrity": "435a4934b4e196e82a8233f724da525f7b7112f3566502f28815e94764c19159",
|
||||
"dependencies": [
|
||||
"jsr:@std/cli",
|
||||
"jsr:@std/encoding@^1.0.10",
|
||||
"jsr:@std/fmt@^1.0.7",
|
||||
"jsr:@std/html@^1.0.3",
|
||||
"jsr:@std/media-types@^1.1.0",
|
||||
"jsr:@std/net",
|
||||
"jsr:@std/path@^1.0.9",
|
||||
"jsr:@std/streams@^1.0.9"
|
||||
]
|
||||
},
|
||||
"@std/internal@1.0.6": {
|
||||
"integrity": "9533b128f230f73bd209408bb07a4b12f8d4255ab2a4d22a1fd6d87304aca9a4"
|
||||
},
|
||||
"@std/io@0.225.0": {
|
||||
"integrity": "c1db7c5e5a231629b32d64b9a53139445b2ca640d828c26bf23e1c55f8c079b3"
|
||||
"integrity": "c1db7c5e5a231629b32d64b9a53139445b2ca640d828c26bf23e1c55f8c079b3",
|
||||
"dependencies": [
|
||||
"jsr:@std/bytes@^1.0.2"
|
||||
]
|
||||
},
|
||||
"@std/json@1.0.2": {
|
||||
"integrity": "d9e5497801c15fb679f55a2c01c7794ad7a5dfda4dd1bebab5e409cb5e0d34d4"
|
||||
@@ -152,6 +246,9 @@
|
||||
"@std/media-types@1.1.0": {
|
||||
"integrity": "c9d093f0c05c3512932b330e3cc1fe1d627b301db33a4c2c2185c02471d6eaa4"
|
||||
},
|
||||
"@std/net@1.0.4": {
|
||||
"integrity": "2f403b455ebbccf83d8a027d29c5a9e3a2452fea39bb2da7f2c04af09c8bc852"
|
||||
},
|
||||
"@std/path@1.0.9": {
|
||||
"integrity": "260a49f11edd3db93dd38350bf9cd1b4d1366afa98e81b86167b4e3dd750129e"
|
||||
},
|
||||
@@ -159,17 +256,30 @@
|
||||
"integrity": "529f79e83705714c105ad0ba55bec0f9da0f24d2f726b6cc1c15e505cc2c0624"
|
||||
},
|
||||
"@std/streams@1.0.9": {
|
||||
"integrity": "a9d26b1988cdd7aa7b1f4b51e1c36c1557f3f252880fa6cc5b9f37078b1a5035"
|
||||
"integrity": "a9d26b1988cdd7aa7b1f4b51e1c36c1557f3f252880fa6cc5b9f37078b1a5035",
|
||||
"dependencies": [
|
||||
"jsr:@std/bytes@^1.0.5"
|
||||
]
|
||||
},
|
||||
"@std/testing@1.0.11": {
|
||||
"integrity": "12b3db12d34f0f385a26248933bde766c0f8c5ad8b6ab34d4d38f528ab852f48",
|
||||
"dependencies": [
|
||||
"jsr:@std/assert",
|
||||
"jsr:@std/data-structures",
|
||||
"jsr:@std/fs@^1.0.16",
|
||||
"jsr:@std/internal",
|
||||
"jsr:@std/path@^1.0.8"
|
||||
]
|
||||
},
|
||||
"@std/toml@1.0.5": {
|
||||
"integrity": "08061156e9c5716443a144b6e40a8668738b8b424ad99ab0b6fdf1b6ea4da806",
|
||||
"dependencies": [
|
||||
"jsr:@std/collections"
|
||||
]
|
||||
},
|
||||
"@std/yaml@1.0.6": {
|
||||
"integrity": "c9a5a914e1d51c46756cb10e356710035cfa905e713c90d3b711413fd3aead27"
|
||||
},
|
||||
"@zip-js/zip-js@2.7.60": {
|
||||
"integrity": "6bb6cf0d02b64ca9acba8c7bc072293609ec3bad584db2b5cf3bb089e031ea0e"
|
||||
}
|
||||
@@ -353,6 +463,33 @@
|
||||
"@opentelemetry/api@1.9.0": {
|
||||
"integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg=="
|
||||
},
|
||||
"@opentelemetry/core@1.30.1_@opentelemetry+api@1.9.0": {
|
||||
"integrity": "sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ==",
|
||||
"dependencies": [
|
||||
"@opentelemetry/api",
|
||||
"@opentelemetry/semantic-conventions"
|
||||
]
|
||||
},
|
||||
"@opentelemetry/resources@1.30.1_@opentelemetry+api@1.9.0": {
|
||||
"integrity": "sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA==",
|
||||
"dependencies": [
|
||||
"@opentelemetry/api",
|
||||
"@opentelemetry/core",
|
||||
"@opentelemetry/semantic-conventions"
|
||||
]
|
||||
},
|
||||
"@opentelemetry/sdk-trace-base@1.30.1_@opentelemetry+api@1.9.0": {
|
||||
"integrity": "sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg==",
|
||||
"dependencies": [
|
||||
"@opentelemetry/api",
|
||||
"@opentelemetry/core",
|
||||
"@opentelemetry/resources",
|
||||
"@opentelemetry/semantic-conventions"
|
||||
]
|
||||
},
|
||||
"@opentelemetry/semantic-conventions@1.28.0": {
|
||||
"integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA=="
|
||||
},
|
||||
"@pkgjs/parseargs@0.11.0": {
|
||||
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg=="
|
||||
},
|
||||
@@ -1025,8 +1162,7 @@
|
||||
"yaml"
|
||||
],
|
||||
"optionalPeers": [
|
||||
"postcss@>=8.0.9",
|
||||
"ts-node@>=9.0.0"
|
||||
"postcss@8.5.3"
|
||||
]
|
||||
},
|
||||
"postcss-merge-longhand@6.0.5_postcss@8.4.35": {
|
||||
@@ -1440,7 +1576,25 @@
|
||||
"bin": true
|
||||
}
|
||||
},
|
||||
"redirects": {
|
||||
"https://esm.sh/@types/react@~19.0.7/index.d.ts": "https://esm.sh/@types/react@19.0.14/index.d.ts"
|
||||
},
|
||||
"remote": {
|
||||
"https://deno.land/std@0.120.0/async/deadline.ts": "1d6ac7aeaee22f75eb86e4e105d6161118aad7b41ae2dd14f4cfd3bf97472b93",
|
||||
"https://deno.land/std@0.120.0/async/debounce.ts": "b2f693e4baa16b62793fd618de6c003b63228db50ecfe3bd51fc5f6dc0bc264b",
|
||||
"https://deno.land/std@0.120.0/async/deferred.ts": "ab60d46ba561abb3b13c0c8085d05797a384b9f182935f051dc67136817acdee",
|
||||
"https://deno.land/std@0.120.0/async/delay.ts": "f2d8ccaa8ebc26594bd8b0989edfd8a96257a714c1dee2fb54d986e5bdd840ac",
|
||||
"https://deno.land/std@0.120.0/async/mod.ts": "78425176fabea7bd1046ce3819fd69ce40da85c83e0f174d17e8e224a91f7d10",
|
||||
"https://deno.land/std@0.120.0/async/mux_async_iterator.ts": "62abff3af9ff619e8f2adc96fc70d4ca020fa48a50c23c13f12d02ed2b760dbe",
|
||||
"https://deno.land/std@0.120.0/async/pool.ts": "353ce4f91865da203a097aa6f33de8966340c91b6f4a055611c8c5d534afd12f",
|
||||
"https://deno.land/std@0.120.0/async/tee.ts": "3e9f2ef6b36e55188de16a667c702ace4ad0cf84e3720379160e062bf27348ad",
|
||||
"https://deno.land/std@0.120.0/http/http_status.ts": "2ff185827bff21c7be2807fcb09a6a2166464ba57fcd94afe805abab8e09070a",
|
||||
"https://deno.land/std@0.120.0/http/server.ts": "d0be8a9da160255623e645f5b515fa1c6b65eecfbb9cad87ef8002d4f8d56616",
|
||||
"https://deno.land/std@0.143.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74",
|
||||
"https://deno.land/std@0.143.0/datetime/formatter.ts": "7c8e6d16a0950f400aef41b9f1eb9168249869776ec520265dfda785d746589e",
|
||||
"https://deno.land/std@0.143.0/datetime/mod.ts": "dcab9ae7be83cbf74b7863e83bd16e7c646a8dea2f019092905630eb7a545739",
|
||||
"https://deno.land/std@0.143.0/datetime/tokenizer.ts": "7381e28f6ab51cb504c7e132be31773d73ef2f3e1e50a812736962b9df1e8c47",
|
||||
"https://deno.land/std@0.143.0/http/cookie.ts": "526f27762fad7bf84fbe491de7eba7c406057501eec6edcad7884a16b242fddf",
|
||||
"https://deno.land/std@0.93.0/_util/assert.ts": "2f868145a042a11d5ad0a3c748dcf580add8a0dbc0e876eaa0026303a5488f58",
|
||||
"https://deno.land/std@0.93.0/_util/os.ts": "e282950a0eaa96760c0cf11e7463e66babd15ec9157d4c9ed49cc0925686f6a7",
|
||||
"https://deno.land/std@0.93.0/fs/walk.ts": "8d37f2164a7397668842a7cb5d53b9e7bcd216462623b1b96abe519f76d7f8b9",
|
||||
@@ -1452,11 +1606,21 @@
|
||||
"https://deno.land/std@0.93.0/path/mod.ts": "4465dc494f271b02569edbb4a18d727063b5dbd6ed84283ff906260970a15d12",
|
||||
"https://deno.land/std@0.93.0/path/posix.ts": "f56c3c99feb47f30a40ce9d252ef6f00296fa7c0fcb6dd81211bdb3b8b99ca3b",
|
||||
"https://deno.land/std@0.93.0/path/separator.ts": "8fdcf289b1b76fd726a508f57d3370ca029ae6976fcde5044007f062e643ff1c",
|
||||
"https://deno.land/std@0.93.0/path/win32.ts": "77f7b3604e0de40f3a7c698e8a79e7f601dc187035a1c21cb1e596666ce112f8"
|
||||
"https://deno.land/std@0.93.0/path/win32.ts": "77f7b3604e0de40f3a7c698e8a79e7f601dc187035a1c21cb1e596666ce112f8",
|
||||
"https://deno.land/x/case@2.1.1/lowerCase.ts": "86d5533f9587ed60003181591e40e648838c23f371edfa79d00288153d113b16",
|
||||
"https://deno.land/x/case@2.1.1/normalCase.ts": "6a8b924da9ab0790d99233ae54bfcfc996d229cb91b2533639fe20972cc33dac",
|
||||
"https://deno.land/x/case@2.1.1/snakeCase.ts": "ee2ab4e2c931d30bb79190d090c21eb5c00d1de1b7a9a3e7f33e035ae431333b",
|
||||
"https://deno.land/x/case@2.1.1/types.ts": "8e2bd6edaa27c0d1972c0d5b76698564740f37b4d3787d58d1fb5f48de611e61",
|
||||
"https://deno.land/x/case@2.1.1/vendor/camelCaseRegexp.ts": "7d9ff02aad4ab6429eeab7c7353f7bcdd6cc5909a8bd3dda97918c8bbb7621ae",
|
||||
"https://deno.land/x/case@2.1.1/vendor/camelCaseUpperRegexp.ts": "292de54a698370f90adcdf95727993d09888b7f33d17f72f8e54ba75f7791787",
|
||||
"https://deno.land/x/case@2.1.1/vendor/nonWordRegexp.ts": "c1a052629a694144b48c66b0175a22a83f4d61cb40f4e45293fc5d6b123f927e",
|
||||
"https://esm.sh/@docsearch/js@3.5.2/es2020/js.mjs": "9b278cf3c0b26feded7d8efeac8e2b50f76bbafcf173a95002944bcc3482830a",
|
||||
"https://esm.sh/@docsearch/js@3.5.2?target=es2020": "4bad084f771a1923fe042ece62a9078f482f8642cb0b1acb890905e58586fee7",
|
||||
"https://raw.githubusercontent.com/denoland/ga4/main/mod.ts": "36f72ba1c90b5ebdb811427f367cd95fa6772d2de2fb45d6e57550501ee6d476"
|
||||
},
|
||||
"workspace": {
|
||||
"dependencies": [
|
||||
"jsr:@astral/astral@~0.4.6",
|
||||
"jsr:@astral/astral@~0.5.2",
|
||||
"jsr:@deno/doc@0.172",
|
||||
"jsr:@fresh/core@^2.0.0-alpha.26",
|
||||
"jsr:@luca/esbuild-deno-loader@0.11",
|
||||
|
||||
@@ -176,7 +176,7 @@ Deno.test("init - can start dev server", async () => {
|
||||
await patchProject(dir);
|
||||
await withChildProcessServer(
|
||||
dir,
|
||||
path.join(dir, "dev.ts"),
|
||||
"dev",
|
||||
async (address) => {
|
||||
await withBrowser(async (page) => {
|
||||
await page.goto(address);
|
||||
@@ -201,7 +201,7 @@ Deno.test("init - can start built project", async () => {
|
||||
|
||||
// Build
|
||||
await new Deno.Command(Deno.execPath(), {
|
||||
args: ["run", "-A", path.join(dir, "dev.ts"), "build"],
|
||||
args: ["task", "build"],
|
||||
stdin: "null",
|
||||
stdout: "piped",
|
||||
stderr: "piped",
|
||||
@@ -210,7 +210,7 @@ Deno.test("init - can start built project", async () => {
|
||||
|
||||
await withChildProcessServer(
|
||||
dir,
|
||||
path.join(dir, "main.ts"),
|
||||
"start",
|
||||
async (address) => {
|
||||
await withBrowser(async (page) => {
|
||||
await page.goto(address);
|
||||
@@ -234,7 +234,7 @@ Deno.test("init - errors on missing build cache in prod", async () => {
|
||||
await patchProject(dir);
|
||||
|
||||
const cp = await new Deno.Command(Deno.execPath(), {
|
||||
args: ["run", "-A", "main.ts"],
|
||||
args: ["task", "start"],
|
||||
stdin: "null",
|
||||
stdout: "piped",
|
||||
stderr: "piped",
|
||||
|
||||
@@ -92,8 +92,6 @@ Deno.test({
|
||||
assertSelector(doc, "a[href='/'][data-ancestor]");
|
||||
assertSelector(doc, `a[href='/'][aria-current="true"]`);
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -176,6 +174,4 @@ Deno.test({
|
||||
assertSelector(doc, `a[href='/'][aria-current="true"]`);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
@@ -64,8 +64,6 @@ Deno.test({
|
||||
await waitForText(page, ".output", "4");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -96,8 +94,6 @@ Deno.test({
|
||||
await waitForText(page, "#multiple-2 .output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -127,8 +123,6 @@ Deno.test({
|
||||
await waitForText(page, "#counter-2 .output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -157,8 +151,6 @@ Deno.test({
|
||||
expect(json).toEqual({ foo: 123 });
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -182,8 +174,6 @@ Deno.test({
|
||||
await page.locator(".ready").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -214,8 +204,6 @@ Deno.test({
|
||||
expect(html).not.toContain("import { Counter }");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -244,8 +232,6 @@ Deno.test({
|
||||
expect(doc.querySelector(".children")!.childNodes.length).toEqual(0);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -276,8 +262,6 @@ Deno.test({
|
||||
expect(JSON.parse(text)).toEqual({ jsx: true, children: true });
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -313,8 +297,6 @@ Deno.test({
|
||||
expect(childText).toEqual("foobar");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -347,8 +329,6 @@ Deno.test({
|
||||
await waitForText(page, ".output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -392,8 +372,6 @@ Deno.test({
|
||||
await waitForText(page, ".children .output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -436,8 +414,6 @@ Deno.test({
|
||||
await waitForText(page, "#b .output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -481,8 +457,6 @@ Deno.test({
|
||||
await waitForText(page, ".children .output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -557,8 +531,6 @@ Deno.test({
|
||||
expect(radio2).toEqual(true);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -589,8 +561,6 @@ Deno.test({
|
||||
expect(text).toEqual("it works");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -620,8 +590,6 @@ Deno.test({
|
||||
expect(text).toEqual("it works");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -650,8 +618,6 @@ Deno.test({
|
||||
expect(text).toEqual("value: production");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -677,8 +643,6 @@ Deno.test({
|
||||
await waitForText(page, ".output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -709,8 +673,6 @@ Deno.test({
|
||||
expect(falsy).toEqual("false");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -739,8 +701,6 @@ Deno.test({
|
||||
expect(text).toEqual("it works");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -767,6 +727,4 @@ Deno.test({
|
||||
/<\/_fresh\/js\/[a-zA-Z0-9]+\/fresh-runtime\.js>; rel="modulepreload"; as="script", <\/_fresh\/js\/[a-zA-Z0-9]+\/SelfCounter\.js>; rel="modulepreload"; as="script"/,
|
||||
);
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
@@ -79,8 +79,6 @@ Deno.test({
|
||||
await waitForText(page, ".output", "partial update");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -124,8 +122,6 @@ Deno.test({
|
||||
assertNotSelector(doc, ".init");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -168,8 +164,6 @@ Deno.test({
|
||||
);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -210,8 +204,6 @@ Deno.test({
|
||||
|
||||
// TODO: Check error overlay
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
// See https://github.com/denoland/fresh/issues/2254
|
||||
@@ -257,8 +249,6 @@ Deno.test({
|
||||
expect(didError).toEqual(false);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -299,8 +289,6 @@ Deno.test({
|
||||
await page.locator(".ready").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -334,8 +322,6 @@ Deno.test({
|
||||
|
||||
// TODO: Test error overlay
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -378,8 +364,6 @@ Deno.test({
|
||||
});
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -426,8 +410,6 @@ Deno.test({
|
||||
expect(counter).toEqual("1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -476,8 +458,6 @@ Deno.test({
|
||||
assertNotSelector(doc, ".output");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -519,8 +499,6 @@ Deno.test({
|
||||
await page.locator(".inner-update").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -574,8 +552,6 @@ Deno.test({
|
||||
await page.locator(".sib-3-update").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -637,8 +613,6 @@ Deno.test({
|
||||
await waitForText(page, "#c .output", "3");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -713,8 +687,6 @@ Deno.test({
|
||||
await waitForText(page, "#c .output", "3");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -789,8 +761,6 @@ Deno.test({
|
||||
await waitForText(page, "#c .output", "3");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -858,8 +828,6 @@ Deno.test({
|
||||
await waitForText(page, "#c .output", "3");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -929,8 +897,6 @@ Deno.test({
|
||||
assertNotSelector(doc, ".done-0");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -981,8 +947,6 @@ Deno.test({
|
||||
assertNotSelector(doc, ".done-0");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1031,8 +995,6 @@ Deno.test({
|
||||
expect(doc.querySelector(".content")!.textContent).toEqual("init01");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1084,8 +1046,6 @@ Deno.test({
|
||||
expect(doc.querySelector(".content")!.textContent).toEqual("init01");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1133,8 +1093,6 @@ Deno.test({
|
||||
expect(doc.querySelector(".content")!.textContent).toEqual("10init");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1186,8 +1144,6 @@ Deno.test({
|
||||
expect(doc.querySelector(".content")!.textContent).toEqual("10init");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1244,8 +1200,6 @@ Deno.test({
|
||||
});
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1301,8 +1255,6 @@ Deno.test({
|
||||
});
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1387,8 +1339,6 @@ Deno.test({
|
||||
await waitForText(page, ".output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1473,8 +1423,6 @@ Deno.test({
|
||||
await waitForText(page, ".output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1541,8 +1489,6 @@ Deno.test({
|
||||
});
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1609,8 +1555,6 @@ Deno.test({
|
||||
});
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1671,8 +1615,6 @@ Deno.test({
|
||||
});
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1729,8 +1671,6 @@ Deno.test({
|
||||
expect(scroll.scrollY > 100).toEqual(true);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1783,8 +1723,6 @@ Deno.test({
|
||||
await page.locator(".done-foo-sub").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1840,8 +1778,6 @@ Deno.test({
|
||||
expect(pathname).toEqual("/foo");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1895,8 +1831,6 @@ Deno.test({
|
||||
await page.locator(".done-foo-sub").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -1951,8 +1885,6 @@ Deno.test({
|
||||
expect(pathname).toEqual("/done");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2012,8 +1944,6 @@ Deno.test({
|
||||
await page.locator(".done-foo-sub").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2074,8 +2004,6 @@ Deno.test({
|
||||
await page.locator(".done-foo-sub").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2144,8 +2072,6 @@ Deno.test({
|
||||
assertNotSelector(doc, "button");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2204,8 +2130,6 @@ Deno.test({
|
||||
await page.locator(".done-a-b-c").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2234,8 +2158,6 @@ Deno.test({
|
||||
expect(logs).toEqual([]);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2271,8 +2193,6 @@ Deno.test({
|
||||
expect(scroll > 0).toEqual(true);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2318,8 +2238,6 @@ Deno.test({
|
||||
expect(logs[0]).toMatch(/Found no partials/);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2416,8 +2334,6 @@ Deno.test({
|
||||
expect(textColor).toEqual("rgb(0, 128, 0)");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2505,8 +2421,6 @@ Deno.test({
|
||||
).toEqual(true);
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2547,8 +2461,6 @@ Deno.test({
|
||||
await page.locator(".status-refreshed").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2602,8 +2514,6 @@ Deno.test({
|
||||
await waitForText(page, "#inner .output", "1");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2642,8 +2552,6 @@ Deno.test({
|
||||
await page.locator(".done").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2681,8 +2589,6 @@ Deno.test({
|
||||
await page.locator(".error-404").wait();
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2723,8 +2629,6 @@ Deno.test({
|
||||
expect(title).toEqual("after update");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
@@ -2768,6 +2672,4 @@ Deno.test({
|
||||
expect(`${url.pathname}${url.search}`).toEqual("/");
|
||||
});
|
||||
},
|
||||
sanitizeResources: false,
|
||||
sanitizeOps: false,
|
||||
});
|
||||
|
||||
+42
-61
@@ -79,86 +79,67 @@ export async function withBrowserApp(
|
||||
fn: (page: Page, address: string) => void | Promise<void>,
|
||||
) {
|
||||
const aborter = new AbortController();
|
||||
let server: Deno.HttpServer | null = null;
|
||||
let port = 0;
|
||||
const server = Deno.serve({
|
||||
hostname: "localhost",
|
||||
port: 0,
|
||||
signal: aborter.signal,
|
||||
}, await app.handler());
|
||||
|
||||
const browser = await launch({
|
||||
args: [
|
||||
"--window-size=1280,720",
|
||||
...((Deno.env.get("CI") && Deno.build.os === "linux")
|
||||
? ["--no-sandbox"]
|
||||
: []),
|
||||
],
|
||||
headless: true,
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
try {
|
||||
server = await Deno.serve({
|
||||
hostname: "localhost",
|
||||
port: 0,
|
||||
signal: aborter.signal,
|
||||
onListen: ({ port: p }) => {
|
||||
port = p;
|
||||
},
|
||||
}, await app.handler());
|
||||
|
||||
const browser = await launch({
|
||||
args: [
|
||||
"--window-size=1280,720",
|
||||
...((Deno.env.get("CI") && Deno.build.os === "linux")
|
||||
? ["--no-sandbox"]
|
||||
: []),
|
||||
],
|
||||
headless: !Deno.args.includes("--headful"),
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
try {
|
||||
await fn(page, `http://localhost:${port}`);
|
||||
} finally {
|
||||
await page.close();
|
||||
await browser.close();
|
||||
}
|
||||
await fn(page, `http://localhost:${server.addr.port}`);
|
||||
} finally {
|
||||
await page.close();
|
||||
await browser.close();
|
||||
aborter.abort();
|
||||
await server?.finished;
|
||||
}
|
||||
}
|
||||
|
||||
export async function withBrowser(fn: (page: Page) => void | Promise<void>) {
|
||||
const aborter = new AbortController();
|
||||
const browser = await launch({
|
||||
args: [
|
||||
"--window-size=1280,7201",
|
||||
...((Deno.env.get("CI") && Deno.build.os === "linux")
|
||||
? ["--no-sandbox"]
|
||||
: []),
|
||||
],
|
||||
headless: true,
|
||||
});
|
||||
const page = await browser.newPage();
|
||||
try {
|
||||
const browser = await launch({
|
||||
args: [
|
||||
"--window-size=1280,7201",
|
||||
...((Deno.env.get("CI") && Deno.build.os === "linux")
|
||||
? ["--no-sandbox"]
|
||||
: []),
|
||||
],
|
||||
headless: !Deno.args.includes("--headful"),
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
// page.setDefaultTimeout(1000000);
|
||||
try {
|
||||
await fn(page);
|
||||
} catch (err) {
|
||||
try {
|
||||
const raw = await page.content();
|
||||
const doc = parseHtml(raw);
|
||||
const html = prettyDom(doc);
|
||||
// deno-lint-ignore no-console
|
||||
console.log(html);
|
||||
} catch {
|
||||
// Ignore
|
||||
}
|
||||
throw err;
|
||||
} finally {
|
||||
await page.close();
|
||||
await browser.close();
|
||||
}
|
||||
await fn(page);
|
||||
} catch (err) {
|
||||
const raw = await page.content();
|
||||
const doc = parseHtml(raw);
|
||||
const html = prettyDom(doc);
|
||||
// deno-lint-ignore no-console
|
||||
console.log(html);
|
||||
throw err;
|
||||
} finally {
|
||||
aborter.abort();
|
||||
await page.close();
|
||||
await browser.close();
|
||||
}
|
||||
}
|
||||
|
||||
export async function withChildProcessServer(
|
||||
dir: string,
|
||||
entry: string,
|
||||
task: string,
|
||||
fn: (address: string) => void | Promise<void>,
|
||||
) {
|
||||
const aborter = new AbortController();
|
||||
const cp = await new Deno.Command(Deno.execPath(), {
|
||||
args: ["run", "-A", entry],
|
||||
args: ["task", task],
|
||||
stdin: "null",
|
||||
stdout: "piped",
|
||||
stderr: "inherit",
|
||||
|
||||
Reference in New Issue
Block a user