@as-pect/assembly 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -34
- package/assembly/index.ts +24 -24
- package/assembly/internal/Actual.ts +20 -20
- package/assembly/internal/Expectation.ts +544 -481
- package/assembly/internal/Expected.ts +55 -55
- package/assembly/internal/Reflect.ts +698 -662
- package/assembly/internal/ReflectedValueType.ts +17 -17
- package/assembly/internal/Test.ts +81 -81
- package/assembly/internal/assert.ts +3 -3
- package/assembly/internal/call.ts +3 -3
- package/assembly/internal/comparison/toIncludeComparison.ts +67 -62
- package/assembly/internal/comparison/toIncludeEqualComparison.ts +91 -78
- package/assembly/internal/log.ts +19 -18
- package/assembly/internal/noOp.ts +3 -2
- package/package.json +17 -10
- package/types/as-pect.d.ts +733 -733
- package/types/as-pect.portable.d.ts +389 -389
- package/types/env.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# jtenner/as-pect - @as-pect/assembly
|
|
2
|
-
|
|
3
|
-
[](https://greenkeeper.io/)
|
|
4
|
-
[](https://travis-ci.org/jtenner/as-pect)
|
|
5
|
-
[](https://coveralls.io/github/jtenner/as-pect?branch=master)
|
|
6
|
-
[](https://lerna.js.org/)
|
|
7
|
-
|
|
8
|
-
Write your module in AssemblyScript and get blazing fast bootstrapped tests
|
|
9
|
-
with WebAssembly speeds!
|
|
10
|
-
|
|
11
|
-
## Documentation
|
|
12
|
-
|
|
13
|
-
To view the documentation, it's located [here](https://tenner-joshua.gitbook.io/as-pect/) on the gitbook. If there are any issues with the docs, please feel free to file an issue!
|
|
14
|
-
|
|
15
|
-
## Contributors
|
|
16
|
-
|
|
17
|
-
To contribute please see [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
18
|
-
|
|
19
|
-
Thanks to [@willemneal](https://github.com/willemneal) and
|
|
20
|
-
[@MaxGraey](https://github.com/maxgraey) for all their support in making `as-pect` the
|
|
21
|
-
best software it can be.
|
|
22
|
-
|
|
23
|
-
Other Contributors:
|
|
24
|
-
|
|
25
|
-
- [@trusktr](https://github.com/trusktr) - Documentation Changes
|
|
26
|
-
- [@MaxGraey](https://github.com/maxgraey) - Performance API suggestions
|
|
27
|
-
- [@torch2424](https://github.com/torch2424) - Documentation Changes
|
|
28
|
-
- [@
|
|
29
|
-
- [@9oelM](https://github.com/9oelM) - Misc functionalities
|
|
30
|
-
|
|
31
|
-
## Special Thanks
|
|
32
|
-
|
|
33
|
-
Special thanks to the [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)
|
|
34
|
-
team for creating AssemblyScript itself.
|
|
1
|
+
# jtenner/as-pect - @as-pect/assembly
|
|
2
|
+
|
|
3
|
+
[](https://greenkeeper.io/)
|
|
4
|
+
[](https://travis-ci.org/jtenner/as-pect)
|
|
5
|
+
[](https://coveralls.io/github/jtenner/as-pect?branch=master)
|
|
6
|
+
[](https://lerna.js.org/)
|
|
7
|
+
|
|
8
|
+
Write your module in AssemblyScript and get blazing fast bootstrapped tests
|
|
9
|
+
with WebAssembly speeds!
|
|
10
|
+
|
|
11
|
+
## Documentation
|
|
12
|
+
|
|
13
|
+
To view the documentation, it's located [here](https://tenner-joshua.gitbook.io/as-pect/) on the gitbook. If there are any issues with the docs, please feel free to file an issue!
|
|
14
|
+
|
|
15
|
+
## Contributors
|
|
16
|
+
|
|
17
|
+
To contribute please see [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
18
|
+
|
|
19
|
+
Thanks to [@willemneal](https://github.com/willemneal) and
|
|
20
|
+
[@MaxGraey](https://github.com/maxgraey) for all their support in making `as-pect` the
|
|
21
|
+
best software it can be.
|
|
22
|
+
|
|
23
|
+
Other Contributors:
|
|
24
|
+
|
|
25
|
+
- [@trusktr](https://github.com/trusktr) - Documentation Changes
|
|
26
|
+
- [@MaxGraey](https://github.com/maxgraey) - Performance API suggestions
|
|
27
|
+
- [@torch2424](https://github.com/torch2424) - Documentation Changes
|
|
28
|
+
- [@dcodeIO](https://github.com/dcodeIO) - Made AssemblyScript itself!
|
|
29
|
+
- [@9oelM](https://github.com/9oelM) - Misc functionalities
|
|
30
|
+
|
|
31
|
+
## Special Thanks
|
|
32
|
+
|
|
33
|
+
Special thanks to the [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)
|
|
34
|
+
team for creating AssemblyScript itself.
|
package/assembly/index.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
/// <reference path="../../../node_modules/assemblyscript/std/assembly/rt/index.d.ts" />
|
|
3
|
-
/// <reference path="../types/as-pect.d.ts" />
|
|
4
|
-
import { expect, Expectation } from "./internal/Expectation";
|
|
5
|
-
import {
|
|
6
|
-
afterAll,
|
|
7
|
-
afterEach,
|
|
8
|
-
beforeAll,
|
|
9
|
-
beforeEach,
|
|
10
|
-
debug,
|
|
11
|
-
describe,
|
|
12
|
-
it,
|
|
13
|
-
itThrows,
|
|
14
|
-
test,
|
|
15
|
-
throws,
|
|
16
|
-
todo,
|
|
17
|
-
xit,
|
|
18
|
-
xtest,
|
|
19
|
-
} from "./internal/Test";
|
|
20
|
-
import { log } from "./internal/log";
|
|
21
|
-
import { Reflect } from "./internal/Reflect";
|
|
22
|
-
import { Expected } from "./internal/Expected";
|
|
23
|
-
export { __call } from "./internal/call";
|
|
24
|
-
export { __ignoreLogs } from "./internal/log";
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/// <reference path="../../../node_modules/assemblyscript/std/assembly/rt/index.d.ts" />
|
|
3
|
+
/// <reference path="../types/as-pect.d.ts" />
|
|
4
|
+
import { expect, Expectation } from "./internal/Expectation";
|
|
5
|
+
import {
|
|
6
|
+
afterAll,
|
|
7
|
+
afterEach,
|
|
8
|
+
beforeAll,
|
|
9
|
+
beforeEach,
|
|
10
|
+
debug,
|
|
11
|
+
describe,
|
|
12
|
+
it,
|
|
13
|
+
itThrows,
|
|
14
|
+
test,
|
|
15
|
+
throws,
|
|
16
|
+
todo,
|
|
17
|
+
xit,
|
|
18
|
+
xtest,
|
|
19
|
+
} from "./internal/Test";
|
|
20
|
+
import { log } from "./internal/log";
|
|
21
|
+
import { Reflect } from "./internal/Reflect";
|
|
22
|
+
import { Expected } from "./internal/Expected";
|
|
23
|
+
export { __call } from "./internal/call";
|
|
24
|
+
export { __ignoreLogs } from "./internal/log";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
// @ts-ignore: Decorators *are* valid here!
|
|
2
|
-
@external("__aspect", "reportActualReflectedValue")
|
|
3
|
-
declare function reportActualReflectedValue(id: i32): void;
|
|
4
|
-
|
|
5
|
-
// @ts-ignore: Decorators *are* valid here!
|
|
6
|
-
@external("__aspect", "clearActual")
|
|
7
|
-
declare function clearActual(): void;
|
|
8
|
-
|
|
9
|
-
@global
|
|
10
|
-
export class Actual {
|
|
11
|
-
static report<T>(actual: T): void {
|
|
12
|
-
let value = Reflect.toReflectedValue(actual);
|
|
13
|
-
Reflect.attachStackTrace(value);
|
|
14
|
-
reportActualReflectedValue(value);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static clear(): void {
|
|
18
|
-
clearActual();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
// @ts-ignore: Decorators *are* valid here!
|
|
2
|
+
@external("__aspect", "reportActualReflectedValue")
|
|
3
|
+
declare function reportActualReflectedValue(id: i32): void;
|
|
4
|
+
|
|
5
|
+
// @ts-ignore: Decorators *are* valid here!
|
|
6
|
+
@external("__aspect", "clearActual")
|
|
7
|
+
declare function clearActual(): void;
|
|
8
|
+
|
|
9
|
+
@global
|
|
10
|
+
export class Actual {
|
|
11
|
+
static report<T>(actual: T): void {
|
|
12
|
+
let value = Reflect.toReflectedValue(actual);
|
|
13
|
+
Reflect.attachStackTrace(value);
|
|
14
|
+
reportActualReflectedValue(value);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static clear(): void {
|
|
18
|
+
clearActual();
|
|
19
|
+
}
|
|
20
|
+
}
|