-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: move test/index.js to mod_test.ts * chore: move test/typings.ts to typings_test.ts * test: format typings_test.ts with deno * test: refactor mod_test.ts to use Deno test * fix(AssertionError): make stack argument optional * build: use deno in build scripts * test: drop test index.html * build: add .tool-versions * build: add coverage folder to gitignore * build: add index.js to gitignore * style: deno fmt * build: drop dist files from package.json * style: deno fmt md files * style: deno fmt package* * build: move dist/mod.d.ts to index.d.ts * refactor: manually write index.d.ts for now Refs: denoland/deno#3385 * build: fix npm files * test: temporarily pass the typings tests * build: add deno ci * build: use denoland/setup-deno * style: deno fmt * build: remove tsconfig Not needed for Deno * build: remove broken coverage assertions * build: remove node build * style: fix all lint errors * fix(AssertionError): captureStackTrace inside consturctor * build: use deno lint * style: deno fmt * style: NAUGHTY DENO
- Loading branch information
Showing
16 changed files
with
345 additions
and
436 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Test Deno Module | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
deno-version: [1.15.2, canary] | ||
|
||
steps: | ||
- name: Git sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Deno Version ${{ matrix.deno-version }} | ||
uses: denoland/[email protected] | ||
with: | ||
deno-version: ${{ matrix.deno-version }} | ||
|
||
- name: Deno Check Fmt | ||
run: deno fmt --check | ||
|
||
- name: Deno Lint | ||
run: deno lint | ||
|
||
- name: Build Deno Module | ||
run: deno bundle --reload mod.ts > index.js | ||
|
||
- name: Test Deno Module | ||
run: deno test --coverage=coverage | ||
|
||
# TODO: coverage broken see https://github.com/denoland/deno/issues/11875 | ||
# - name: Generate lcov | ||
# run: deno coverage coverage --lcov > coverage/lcov.info | ||
|
||
# - name: Assert coverage is good | ||
# uses: VeryGoodOpenSource/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ npm-debug.log | |
|
||
coverage.html | ||
dist | ||
coverage | ||
index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
deno 1.15.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
1.1.0 / 2018-01-02 | ||
================== | ||
# 1.1.0 / 2018-01-02 | ||
|
||
* Add type definitions ([#11](https://github.com/chaijs/assertion-error/pull/11)) | ||
- Add type definitions | ||
([#11](https://github.com/chaijs/assertion-error/pull/11)) | ||
|
||
1.0.1 / 2015-03-04 | ||
================== | ||
# 1.0.1 / 2015-03-04 | ||
|
||
* Merge pull request #2 from simonzack/master | ||
* fixes `.stack` on firefox | ||
- Merge pull request #2 from simonzack/master | ||
- fixes `.stack` on firefox | ||
|
||
1.0.0 / 2013-06-08 | ||
================== | ||
# 1.0.0 / 2013-06-08 | ||
|
||
* readme: change travis and component urls | ||
* refactor: [*] prepare for move to chaijs gh org | ||
- readme: change travis and component urls | ||
- refactor: [*] prepare for move to chaijs gh org | ||
|
||
0.1.0 / 2013-04-07 | ||
================== | ||
# 0.1.0 / 2013-04-07 | ||
|
||
* test: use vanilla test runner/assert | ||
* pgk: remove unused deps | ||
* lib: implement | ||
* "Initial commit" | ||
- test: use vanilla test runner/assert | ||
- pgk: remove unused deps | ||
- lib: implement | ||
- "Initial commit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,14 +35,15 @@ Both `AssertionError` and `AssertionResult` implement the `Result` interface: | |
|
||
```typescript | ||
interface Result { | ||
name: 'AssertionError' | 'AssertionResult' | ||
ok: boolean | ||
toJSON(...args: unknown[]): Record<string, unknown> | ||
name: "AssertionError" | "AssertionResult"; | ||
ok: boolean; | ||
toJSON(...args: unknown[]): Record<string, unknown>; | ||
} | ||
``` | ||
|
||
So if a function returns `AssertionResult | AssertionError` it is easy to check | ||
_which_ one is returned by checking either `.name` or `.ok`, or check `instanceof Error`. | ||
_which_ one is returned by checking either `.name` or `.ok`, or check | ||
`instanceof Error`. | ||
|
||
## Installation | ||
|
||
|
@@ -56,8 +57,12 @@ $ npm install --save assertion-error | |
|
||
### Deno | ||
|
||
`assertion_error` is available on [Deno.land](https://deno.land/x/assertion_error) | ||
`assertion_error` is available on | ||
[Deno.land](https://deno.land/x/assertion_error) | ||
|
||
```typescript | ||
import {AssertionError, AssertionResult} from 'https://deno.land/x/[email protected]/mod.ts' | ||
import { | ||
AssertionError, | ||
AssertionResult, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
interface Result { | ||
name: "AssertionError" | "AssertionResult"; | ||
ok: boolean; | ||
toJSON(...args: unknown[]): Record<string, unknown>; | ||
} | ||
|
||
declare class AssertionError<T> extends Error implements Result { | ||
[key: string]: unknown | ||
name: "AssertionError"; | ||
ok: false; | ||
message: string; | ||
// deno-lint-ignore ban-types | ||
constructor(message: string, props?: T, ssf?: Function); | ||
stack: string; | ||
toJSON(stack?: boolean): Record<string, unknown>; | ||
} | ||
|
||
declare class AssertionResult<T> implements Result { | ||
[key: string]: unknown | ||
name: "AssertionResult"; | ||
ok: true; | ||
message: string; | ||
constructor(props?: T); | ||
toJSON(): Record<string, unknown>; | ||
} | ||
|
||
export { AssertionError, AssertionResult, Result }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.