Skip to content

Commit

Permalink
fix(curl,wget): fix dead URL in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deciduously committed Jan 21, 2025
1 parent d61cab0 commit a890e1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions packages/curl/tangram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,14 @@ export default default_;

export const test = tg.target(async () => {
const result = await $`
set -x
echo "Checking that we can run curl."
curl --version
echo "Checking that we can download a file."
mkdir -p $OUTPUT
curl -o $OUTPUT/example http://example.com
echo "Checking that we can download via HTTPS."
curl -o $OUTPUT/tangram.svg https://www.tangram.dev/tangram.svg
curl -o $OUTPUT/tangram https://www.tangram.dev
`
.env(default_())
.checksum("unsafe")
Expand All @@ -120,11 +121,11 @@ export const test = tg.target(async () => {
tg.assert(exampleContents.length > 0);
tg.assert(exampleContents.startsWith("<!doctype html>"));

const svgContents = await result
.get("tangram.svg")
const tangramContents = await result
.get("tangram")
.then(tg.File.expect)
.then((f) => f.text());
tg.assert(svgContents.length > 0);
tg.assert(svgContents.startsWith("<svg"));
tg.assert(tangramContents.length > 0);
tg.assert(tangramContents.startsWith("<!DOCTYPE html>"));
return true;
});
10 changes: 5 additions & 5 deletions packages/wget/tangram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const test = tg.target(async () => {
mkdir -p $OUTPUT
wget -O $OUTPUT/example http://example.com
echo "Checking that we can download via HTTPS."
wget -O $OUTPUT/tangram.svg https://www.tangram.dev/tangram.svg
wget -O $OUTPUT/tangram https://www.tangram.dev
`
.env(default_())
.checksum("unsafe")
Expand All @@ -129,11 +129,11 @@ export const test = tg.target(async () => {
tg.assert(exampleContents.length > 0);
tg.assert(exampleContents.startsWith("<!doctype html>"));

const svgContents = await result
.get("tangram.svg")
const tangramContents = await result
.get("tangram")
.then(tg.File.expect)
.then((f) => f.text());
tg.assert(svgContents.length > 0);
tg.assert(svgContents.startsWith("<svg"));
tg.assert(tangramContents.length > 0);
tg.assert(tangramContents.startsWith("<!DOCTYPE html>"));
return true;
});

0 comments on commit a890e1f

Please sign in to comment.