summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/fmt/with_config/subdir/a.ts
blob: 5474b3aa37cb72ff0e5a57f127a4c94f06a5e3ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Deno.test(
	{ perms: { net: true } },
	async function responseClone() {
		const response =
			await fetch(
				'http://localhost:4545/assets/fixture.json',
			)
		const response1 =
			response.clone()
		assert(
			response !==
				response1,
		)
		assertEquals(
			response.status,
			response1
				.status,
		)
		assertEquals(
			response.statusText,
			response1
				.statusText,
		)
		const u8a =
			new Uint8Array(
				await response
					.arrayBuffer(),
			)
		const u8a1 =
			new Uint8Array(
				await response1
					.arrayBuffer(),
			)
		for (
			let i = 0;
			i <
				u8a.byteLength;
			i++
		) {
			assertEquals(
				u8a[i],
				u8a1[i],
			)
		}
	},
)