Skip to content

Commit

Permalink
Let's do some automated testing
Browse files Browse the repository at this point in the history
  • Loading branch information
j3lte committed Nov 21, 2023
1 parent 643a38d commit 641d3de
Show file tree
Hide file tree
Showing 9 changed files with 512 additions and 127 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
- name: Check linting
run: deno lint

# - name: Tests
# run: deno task test
- name: Tests
run: deno task test

# - name: Coverage
# run: deno task coverage
- name: Coverage
run: deno task coverage

# Disabled for now
# - name: Upload coverage reports to Codecov
Expand Down
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"format": "deno fmt ./src/",
"lint": "deno lint ./src/",
"test": "deno test --coverage=.coverage",
"coverage": "deno coverage .coverage --lcov --excluse=/src/node/ --exclude=/test/ --exclude=/scripts/ > ./.coverage/coverage.lcov",
"coverage": "deno coverage .coverage --lcov --exclude=/src/node/ --exclude=/test/ --exclude=/scripts/ > ./.coverage/coverage.lcov",
"test:watch": "deno test --watch",
"localTest": "deno run --allow-read --allow-write --allow-run ./scripts/watch-test.ts",
"clean": "rm -r ./coverage",
Expand Down Expand Up @@ -32,6 +32,7 @@
]
},
"exclude": [
"./_local_testing.ts",
"npm/"
]
},
Expand Down
90 changes: 8 additions & 82 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 3 additions & 16 deletions dev_deps.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
export {
assertEquals,
assertMatch,
assertNotEquals,
assertThrows,
} from "https://deno.land/[email protected]/testing/asserts.ts";
export { assertEquals, assertRejects } from "https://deno.land/[email protected]/assert/mod.ts";
export { emptyDir } from "https://deno.land/[email protected]/fs/mod.ts";
import * as mf from "https://deno.land/x/[email protected]/mod.ts";
export { mf };
export {
afterAll,
afterEach,
beforeAll,
beforeEach,
describe,
it,
} from "https://deno.land/[email protected]/testing/bdd.ts";
export { MockFetch } from "https://deno.land/x/[email protected]/mod.ts";
export { resolvesNext, stub } from "https://deno.land/[email protected]/testing/mock.ts";
1 change: 0 additions & 1 deletion mocks/fetch.ts

This file was deleted.

6 changes: 6 additions & 0 deletions src/deno/Pastebin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import { AbstractPastebin } from "../lib/Pastebin.ts";
import { ICreatePasteFileOptions, ICreatePasteTextOptions } from "../lib/interfaces.ts";

export class Pastebin extends AbstractPastebin {
/**
* Create a paste from a file
*
* @param options { ICreatePasteFileOptions } options for creating a paste
* @returns { Promise<string> } returns the url of the created paste
*/
async createPasteFromFile(
options: ICreatePasteFileOptions<Uint8Array> = { file: "" },
): Promise<unknown> {
Expand Down
Loading

0 comments on commit 641d3de

Please sign in to comment.