Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanThatOneKid committed Nov 28, 2021
1 parent e6617e8 commit 538081b
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 16 deletions.
2 changes: 1 addition & 1 deletion deps/std/flags.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { parse } from "https://deno.land/std@0.114.0/flags/mod.ts";
export { parse } from "https://deno.land/std@0.116.0/flags/mod.ts";
2 changes: 1 addition & 1 deletion deps/std/fs.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { exists, expandGlob } from "https://deno.land/std@0.114.0/fs/mod.ts";
export { exists, expandGlob } from "https://deno.land/std@0.116.0/fs/mod.ts";
2 changes: 1 addition & 1 deletion deps/std/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export {
join,
normalize,
parse,
} from "https://deno.land/std@0.114.0/path/mod.ts";
} from "https://deno.land/std@0.116.0/path/mod.ts";
6 changes: 3 additions & 3 deletions deps/std/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ export {
assert,
assertEquals,
assertThrows,
} from "https://deno.land/std@0.114.0/testing/asserts.ts";
} from "https://deno.land/std@0.116.0/testing/asserts.ts";
export {
bench,
runBenchmarks,
} from "https://deno.land/std@0.114.0/testing/bench.ts";
} from "https://deno.land/std@0.116.0/testing/bench.ts";
export type {
BenchmarkResult,
BenchmarkRunProgress,
BenchmarkTimer,
} from "https://deno.land/std@0.114.0/testing/bench.ts";
} from "https://deno.land/std@0.116.0/testing/bench.ts";
7 changes: 7 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ self_link: https://fart.tools/getting-started
> Fart deserves better!
> Curious reader, visit <https://fart.tools/getting-started/>.
## Project Scripts

- **Upgrade a Dependency**: `deno run --unstable --allow-read --allow-write devops/upgrade_dep.ts -y --verbose --dep=std --v=0.116.0`
- **Run the CLI**: `deno run --allow-read --allow-write fart_cli/run.ts ./ex/pokemon/mod.fart --reg=ts --output=./ex/pokemon/mod.out.ts`
- **Spin up Server**: `deno run --allow-net --allow-read --allow-env --unstable fart_server/serve_http.ts`
- **Develop the Server**: `deployctl run --watch fart_server/worker.ts`
10 changes: 0 additions & 10 deletions docs/scripts.md

This file was deleted.

18 changes: 18 additions & 0 deletions lib/cartridge/cartridge.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { assertEquals } from "../../deps/std/testing.ts";
import { Cartridge } from "./cartridge.ts";
import { CartridgeEvent } from "./cartridge_event.ts";
import { CodeBlock } from "../code_block/mod.ts";

/**
* @todo @ethanthatonekid write tests that reflect cartridge api design/usage
Expand All @@ -13,3 +14,20 @@ Deno.test("hello world", () => {
cartridge.on(CartridgeEvent.FileStart, console.log);
assertEquals(1, 1);
});

Deno.test("event 'file_start' makes a successful dispatch", async () => {
const cartridge = new Cartridge();
cartridge.on(CartridgeEvent.FileStart, (event) => {
assertEquals(event.type, CartridgeEvent.FileStart, "matches event name");
assertEquals(event.tokens.length, 0, "expects 0 tokens");
assertEquals(event.data, null, "always null");
return "ABC";
});
const result = await cartridge.dispatch(CartridgeEvent.FileStart, {
type: CartridgeEvent.FileStart,
code: new CodeBlock(),
data: null,
tokens: [],
});
assertEquals(result, "ABC");
});
10 changes: 10 additions & 0 deletions lib/text_builder/text_builder.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { assertEquals } from "../../deps/std/testing.ts";
import { TextBuilder } from "./text_builder.ts";
import { Cartridge } from "../cartridge/mod.ts";

const dummy = new Cartridge();

Deno.test("text builder exports an empty string when nothing is appended", () => {
const builder = new TextBuilder(dummy);
assertEquals(builder.export(), "");
});

1 comment on commit 538081b

@deno-deploy
Copy link

@deno-deploy deno-deploy bot commented on 538081b Nov 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to deploy:

failed to fetch 'https://raw.githubusercontent.com/EthanThatOneKid/fart/538081ba5ddd33874f4354db5053ea6008297d34/std/server/worker.ts': HTTP status client error (404 Not Found) for url (https://raw.githubusercontent.com/EthanThatOneKid/fart/538081ba5ddd33874f4354db5053ea6008297d34/std/server/worker.ts)

Please sign in to comment.