@noeldemartin/solid-utils 0.5.0-next.1ea2ba307e0da5c3ce9d2db1276f930c7aa52c90 → 0.5.0-next.612e9e93903ec33bbcba7105ed2a8580ed2d754c
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/dist/noeldemartin-solid-utils.cjs.js +1 -1
- package/dist/noeldemartin-solid-utils.cjs.js.map +1 -1
- package/dist/noeldemartin-solid-utils.esm.js +1 -1
- package/dist/noeldemartin-solid-utils.esm.js.map +1 -1
- package/dist/noeldemartin-solid-utils.umd.js +1 -1
- package/dist/noeldemartin-solid-utils.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/plugins/chai/assertions.ts +10 -2
- package/src/plugins/cypress/types.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noeldemartin/solid-utils",
|
|
3
|
-
"version": "0.5.0-next.
|
|
3
|
+
"version": "0.5.0-next.612e9e93903ec33bbcba7105ed2a8580ed2d754c",
|
|
4
4
|
"description": "My JavaScript utilities for Solid",
|
|
5
5
|
"main": "dist/noeldemartin-solid-utils.cjs.js",
|
|
6
6
|
"module": "dist/noeldemartin-solid-utils.esm.js",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { sparqlEquals, turtleEquals } from '@/helpers/testing';
|
|
2
|
+
import type { EqualityResult } from '@/helpers/testing';
|
|
2
3
|
|
|
3
4
|
type CustomAssertions = {
|
|
4
5
|
[assertion in keyof typeof assertions]: typeof assertions[assertion];
|
|
@@ -19,7 +20,7 @@ declare global {
|
|
|
19
20
|
const assertions: Record<string, (this: Chai.AssertionStatic, ...args: any[]) => void> = {
|
|
20
21
|
turtle(graph: string): void {
|
|
21
22
|
const self = this as unknown as Chai.AssertionStatic;
|
|
22
|
-
const actual = self._obj;
|
|
23
|
+
const actual = self._obj as string;
|
|
23
24
|
const assert = self.assert.bind(this);
|
|
24
25
|
const expected = graph;
|
|
25
26
|
const result = turtleEquals(expected, actual);
|
|
@@ -28,11 +29,18 @@ const assertions: Record<string, (this: Chai.AssertionStatic, ...args: any[]) =>
|
|
|
28
29
|
},
|
|
29
30
|
sparql(query: string): void {
|
|
30
31
|
const self = this as unknown as Chai.AssertionStatic;
|
|
31
|
-
const actual = self._obj;
|
|
32
|
+
const actual = self._obj as string;
|
|
32
33
|
const assert = self.assert.bind(this);
|
|
33
34
|
const expected = query;
|
|
34
35
|
const result = sparqlEquals(expected, actual);
|
|
35
36
|
|
|
37
|
+
assert(result.success, result.message, '', result.expected, result.actual);
|
|
38
|
+
},
|
|
39
|
+
equalityResult(): void {
|
|
40
|
+
const self = this as unknown as Chai.AssertionStatic;
|
|
41
|
+
const result = self._obj as EqualityResult;
|
|
42
|
+
const assert = self.assert.bind(this);
|
|
43
|
+
|
|
36
44
|
assert(result.success, result.message, '', result.expected, result.actual);
|
|
37
45
|
},
|
|
38
46
|
};
|