@rdfx/testing 0.0.3

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.
@@ -0,0 +1,18 @@
1
+ import type * as RDF from "@rdfjs/types";
2
+ import type { IQuadTerms } from "jest-rdf/lib/matchers/toBeRdfDatasetMatching.js";
3
+ import "vitest";
4
+ declare module "vitest" {
5
+ interface Matchers<T = any> {
6
+ toBeLeft(expected?: unknown): T;
7
+ toBeRdfDatasetContaining: (...actual: RDF.BaseQuad[]) => T;
8
+ toBeRdfDatasetMatching: (match: IQuadTerms<RDF.BaseQuad>, matches?: number) => T;
9
+ toBeRdfDatasetOfSize: (size: number) => T;
10
+ toBeRdfIsomorphic: (actual: Iterable<RDF.BaseQuad>) => T;
11
+ toEqualRdfQuad: (actual: RDF.BaseQuad) => T;
12
+ toEqualRdfQuadArray: (actual: RDF.BaseQuad[]) => T;
13
+ toEqualRdfTerm: (actual: RDF.Term) => T;
14
+ toEqualRdfTermArray: (actual: RDF.Term[]) => T;
15
+ }
16
+ }
17
+ export { matchers } from "./matchers.js";
18
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import "vitest";
2
+ export { matchers } from "./matchers.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ export declare const matchers: {
2
+ toBeLeft: import("vitest").Matcher;
3
+ };
4
+ //# sourceMappingURL=matchers.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { default as jestRdfMatchers } from "jest-rdf/lib/matchers";
2
+ import * as purifyMatchers from "./purifyMatchers.js";
3
+ export const matchers = {
4
+ ...jestRdfMatchers,
5
+ ...purifyMatchers,
6
+ };
7
+ //# sourceMappingURL=matchers.js.map
@@ -0,0 +1,3 @@
1
+ import type { Matcher } from "vitest";
2
+ export declare const toBeLeft: Matcher;
3
+ //# sourceMappingURL=purifyMatchers.d.ts.map
@@ -0,0 +1,36 @@
1
+ import { Either } from "purify-ts";
2
+ function toBeLeftStrict(context, received, expected) {
3
+ if (!received.isLeft()) {
4
+ return {
5
+ pass: false,
6
+ message: () => `expected a Left but received Right(${String(received.extract())})`,
7
+ };
8
+ }
9
+ if (expected !== undefined) {
10
+ const actual = received.extract();
11
+ const pass = context.equals(actual, expected);
12
+ return {
13
+ pass,
14
+ actual,
15
+ expected,
16
+ message: () => pass
17
+ ? `expected Left(${String(actual)}) not to equal Left(${String(expected)})`
18
+ : `expected Left(${String(actual)}) to equal Left(${String(expected)})`,
19
+ };
20
+ }
21
+ return {
22
+ pass: true,
23
+ message: () => `expected not to be a Left`,
24
+ };
25
+ }
26
+ export const toBeLeft = function (received, // must be unknown here
27
+ expected) {
28
+ if (!Either.isEither(received)) {
29
+ return {
30
+ pass: false,
31
+ message: () => `expected an Either but received ${String(received)}`,
32
+ };
33
+ }
34
+ return toBeLeftStrict(this, received, expected);
35
+ };
36
+ //# sourceMappingURL=purifyMatchers.js.map
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "dependencies": {
3
+ "@rdfjs/types": "~2.0.1",
4
+ "jest-rdf": "~2.0.0",
5
+ "purify-ts": "~2.1.4",
6
+ "vitest": "~4.1.5"
7
+ },
8
+ "devDependencies": {},
9
+ "files": [
10
+ "dist/*.d.ts",
11
+ "dist/*.js"
12
+ ],
13
+ "license": "Apache-2.0",
14
+ "main": "./dist/index.js",
15
+ "name": "@rdfx/testing",
16
+ "packageManager": "npm@11.11.0",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/minorg/rdfx.git"
20
+ },
21
+ "scripts": {
22
+ "build": "tsc -b",
23
+ "clean": "rimraf dist",
24
+ "depcheck": "depcheck .",
25
+ "dev": "tsc -w --preserveWatchOutput"
26
+ },
27
+ "type": "module",
28
+ "types": "./dist/index.d.ts",
29
+ "version": "0.0.3"
30
+ }