@traqula/test-utils 0.0.1-alpha.145 → 0.0.1-alpha.176
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 +3 -3
- package/lib/Sparql11NotesTest.d.ts +7 -8
- package/lib/Sparql11NotesTest.js +17 -33
- package/lib/Sparql11NotesTest.js.map +1 -1
- package/lib/fileUtils.d.ts +3 -0
- package/lib/fileUtils.js +6 -0
- package/lib/fileUtils.js.map +1 -0
- package/lib/index.cjs +490 -151
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/matchers/toEqualParsedQuery.js +1 -1
- package/lib/matchers/toEqualParsedQuery.js.map +1 -1
- package/lib/statics/generators.js +12 -10
- package/lib/statics/generators.js.map +1 -1
- package/lib/statics/generators.ts +21 -20
- package/lib/statics/paths/{namedNodeSequence.json → named-node-sequence.json} +2 -2
- package/lib/statics/paths/prefixed.json +2 -2
- package/lib/statics/sparql-1-1/spaced-data-update.json +1 -1
- package/package.json +14 -14
- /package/lib/statics/paths/{namedNodeSequence.sparql → named-node-sequence.sparql} +0 -0
- /package/lib/statics/paths/{namedNode.json → named-node.json} +0 -0
- /package/lib/statics/paths/{namedNode.sparql → named-node.sparql} +0 -0
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC","sourcesContent":["export * from './matchers/toEqualParsedQuery';\nexport * from './matchers/vitest';\nexport * from './statics/generators';\nexport * from './Sparql11NotesTest';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC","sourcesContent":["export * from './matchers/toEqualParsedQuery';\nexport * from './matchers/vitest';\nexport * from './statics/generators';\nexport * from './Sparql11NotesTest';\nexport * from './fileUtils';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Wildcard } from '@traqula/rules-sparql-1-1';
|
|
1
2
|
import { BlankNode, DefaultGraph, NamedNode, Quad, Variable } from 'rdf-data-factory';
|
|
2
3
|
import { expect } from 'vitest';
|
|
3
|
-
import { Wildcard } from '@traqula/core';
|
|
4
4
|
expect.extend({
|
|
5
5
|
toEqualParsedQuery(received, expected) {
|
|
6
6
|
const pass = objectsEqual(received, expected);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toEqualParsedQuery.js","sourceRoot":"","sources":["toEqualParsedQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"toEqualParsedQuery.js","sourceRoot":"","sources":["toEqualParsedQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,MAAM,CAAC;IACZ,kBAAkB,CAAC,QAAQ,EAAE,QAAQ;QACnC,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC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AG,IAAI,WAAW,EAAE,CAAC;YAC9B,6CAA6C;YAC7C,0BAA0B;YAC1B,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBAChD,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,mDAAmD;AACnD,SAAS,MAAM,CAAC,KAAc;IAC5B,OAAO,KAAK,YAAY,YAAY;QAClC,KAAK,YAAY,SAAS;QAC1B,KAAK,YAAY,SAAS;QAC1B,KAAK,YAAY,QAAQ;QACzB,KAAK,YAAY,QAAQ;QACzB,KAAK,YAAY,IAAI,CAAC;AAC1B,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,CAAC;AAC9F,CAAC","sourcesContent":["import { Wildcard } from '@traqula/rules-sparql-1-1';\nimport { BlankNode, DefaultGraph, NamedNode, Quad, Variable } from 'rdf-data-factory';\nimport { expect } from 'vitest';\n\nexpect.extend({\n toEqualParsedQuery(received, expected) {\n const pass = objectsEqual(received, expected);\n const message = pass ?\n () =>\n `${this.utils.matcherHint('toEqualParsedQuery')\n }\\n\\n` +\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Received: ${this.utils.printReceived(received)}` :\n () => {\n const diffString = this.utils.diff(expected, received, {\n expand: this.expand,\n });\n return (\n `${this.utils.matcherHint('toEqualParsedQuery')\n }\\n\\n${\n diffString && diffString.includes('- Expect') ?\n `Difference:\\n\\n${diffString}` :\n `Expected: ${this.utils.printExpected(expected)}\\n` +\n `Received: ${this.utils.printReceived(received)}`}`\n );\n };\n\n return { pass, message };\n },\n});\n\n// We cannot use native instanceOf to test whether expected is a Term!\nfunction objectsEqual(received: unknown, expected: unknown): boolean {\n if (received === undefined || received === null || isPrimitive(received)) {\n return received === expected;\n }\n\n if (isTerm(received)) {\n // eslint-disable-next-line ts/ban-ts-comment\n // @ts-expect-error TS2345\n return received.equals(expected);\n }\n if (isTerm(expected)) {\n // eslint-disable-next-line ts/ban-ts-comment\n // @ts-expect-error TS2345\n return expected.equals(received);\n }\n // York\n // test\n if (Array.isArray(received)) {\n if (!Array.isArray(expected)) {\n return false;\n }\n if (received.length !== expected.length) {\n return false;\n }\n for (const [ i, element ] of received.entries()) {\n if (!objectsEqual(element, expected[i])) {\n return false;\n }\n }\n } else {\n // Received == object\n if (expected === undefined || expected === null || isPrimitive(expected) || Array.isArray(expected)) {\n return false;\n }\n const keys_first = Object.keys(received);\n\n for (const key of keys_first) {\n // eslint-disable-next-line ts/ban-ts-comment\n // @ts-expect-error TS7053\n if (!objectsEqual(received[key], expected[key])) {\n return false;\n }\n }\n\n // We do this to make sure that we are not missing keys in the received object\n const keys_second = Object.keys(expected);\n for (const key of keys_second) {\n // eslint-disable-next-line ts/ban-ts-comment\n // @ts-expect-error TS7053\n if (!objectsEqual(received[key], expected[key])) {\n return false;\n }\n }\n }\n return true;\n}\n\n// If true, the value is a term. With ts annotation\nfunction isTerm(value: unknown): value is { equals: (other: { termType: unknown } | undefined | null) => boolean } {\n return value instanceof DefaultGraph ||\n value instanceof NamedNode ||\n value instanceof BlankNode ||\n value instanceof Variable ||\n value instanceof Wildcard ||\n value instanceof Quad;\n}\n\nfunction isPrimitive(value: unknown): value is string | number | boolean {\n return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n}\n"]}
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/* eslint-disable import/no-nodejs-modules,no-sync */
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import fsp from 'node:fs/promises';
|
|
4
|
+
import * as path from 'node:path';
|
|
3
5
|
export function* positiveTest(type) {
|
|
4
|
-
const dir =
|
|
6
|
+
const dir = path.join(__dirname, type);
|
|
5
7
|
const statics = fs.readdirSync(dir);
|
|
6
8
|
for (const file of statics) {
|
|
7
9
|
if (file.endsWith('.sparql')) {
|
|
8
10
|
yield {
|
|
9
|
-
name: file.replace(/\.sparql
|
|
11
|
+
name: file.replace(/\.sparql$/u, ''),
|
|
10
12
|
statics: async () => {
|
|
11
13
|
const query = await fsp.readFile(`${dir}/${file}`, 'utf-8');
|
|
12
14
|
const result = await fsp.readFile(`${dir}/${file.replace('.sparql', '.json')}`, 'utf-8');
|
|
13
15
|
const json = JSON.parse(result);
|
|
14
16
|
return {
|
|
15
|
-
query
|
|
17
|
+
query,
|
|
16
18
|
result: json,
|
|
17
19
|
};
|
|
18
|
-
}
|
|
20
|
+
},
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
export function* negativeTest(type) {
|
|
24
|
-
const dir =
|
|
26
|
+
const dir = path.join(__dirname, type);
|
|
25
27
|
const statics = fs.readdirSync(dir);
|
|
26
28
|
for (const file of statics) {
|
|
27
29
|
if (file.endsWith('.sparql')) {
|
|
28
30
|
yield {
|
|
29
|
-
name: file.replace(/\.sparql
|
|
31
|
+
name: file.replace(/\.sparql$/u, ''),
|
|
30
32
|
statics: async () => {
|
|
31
33
|
const query = await fsp.readFile(`${dir}/${file}`, 'utf-8');
|
|
32
34
|
return {
|
|
33
|
-
query
|
|
35
|
+
query,
|
|
34
36
|
};
|
|
35
|
-
}
|
|
37
|
+
},
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators.js","sourceRoot":"","sources":["generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,GAAG,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"generators.js","sourceRoot":"","sources":["generators.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,KAAK,EAAE,MAA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AAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,MAAM;gBACJ,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;gBACpC,OAAO,EAAE,KAAK,IAAG,EAAE;oBACjB,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;oBAC5D,OAAO;wBACL,KAAK;qBACN,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/* eslint-disable import/no-nodejs-modules,no-sync */\nimport * as fs from 'node:fs';\nimport fsp from 'node:fs/promises';\nimport * as path from 'node:path';\n\ninterface PositiveTest {\n name: string;\n statics: () => Promise<{\n query: string;\n result: unknown;\n }>;\n}\n\nexport function* positiveTest(type: 'paths' | 'sparql-1-1' | 'sparql-1-2'): Generator<PositiveTest> {\n const dir = path.join(__dirname, type);\n const statics = fs.readdirSync(dir);\n for (const file of statics) {\n if (file.endsWith('.sparql')) {\n yield {\n name: file.replace(/\\.sparql$/u, ''),\n statics: async() => {\n const query = await fsp.readFile(`${dir}/${file}`, 'utf-8');\n const result = await fsp.readFile(`${dir}/${file.replace('.sparql', '.json')}`, 'utf-8');\n const json: unknown = JSON.parse(result);\n return {\n query,\n result: json,\n };\n },\n };\n }\n }\n}\n\ninterface NegativeTest {\n name: string;\n statics: () => Promise<{\n query: string;\n }>;\n}\n\nexport function* negativeTest(type: 'sparql-1-2-invalid'): Generator<NegativeTest> {\n const dir = path.join(__dirname, type);\n const statics = fs.readdirSync(dir);\n for (const file of statics) {\n if (file.endsWith('.sparql')) {\n yield {\n name: file.replace(/\\.sparql$/u, ''),\n statics: async() => {\n const query = await fsp.readFile(`${dir}/${file}`, 'utf-8');\n return {\n query,\n };\n },\n };\n }\n }\n}\n"]}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/* eslint-disable import/no-nodejs-modules,no-sync */
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import fsp from 'node:fs/promises';
|
|
4
|
+
import * as path from 'node:path';
|
|
3
5
|
|
|
4
6
|
interface PositiveTest {
|
|
5
7
|
name: string;
|
|
6
8
|
statics: () => Promise<{
|
|
7
9
|
query: string;
|
|
8
10
|
result: unknown;
|
|
9
|
-
}
|
|
11
|
+
}>;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export function* positiveTest(type: 'paths' | 'sparql-1-1' | 'sparql-1-2'): Generator<PositiveTest> {
|
|
13
|
-
const dir =
|
|
15
|
+
const dir = path.join(__dirname, type);
|
|
14
16
|
const statics = fs.readdirSync(dir);
|
|
15
17
|
for (const file of statics) {
|
|
16
18
|
if (file.endsWith('.sparql')) {
|
|
17
19
|
yield {
|
|
18
|
-
name: file.replace(/\.sparql
|
|
19
|
-
statics: async
|
|
20
|
+
name: file.replace(/\.sparql$/u, ''),
|
|
21
|
+
statics: async() => {
|
|
20
22
|
const query = await fsp.readFile(`${dir}/${file}`, 'utf-8');
|
|
21
23
|
const result = await fsp.readFile(`${dir}/${file.replace('.sparql', '.json')}`, 'utf-8');
|
|
22
24
|
const json: unknown = JSON.parse(result);
|
|
23
25
|
return {
|
|
24
|
-
query
|
|
26
|
+
query,
|
|
25
27
|
result: json,
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
};
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
}
|
|
@@ -34,24 +36,23 @@ interface NegativeTest {
|
|
|
34
36
|
name: string;
|
|
35
37
|
statics: () => Promise<{
|
|
36
38
|
query: string;
|
|
37
|
-
}
|
|
39
|
+
}>;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
|
|
41
42
|
export function* negativeTest(type: 'sparql-1-2-invalid'): Generator<NegativeTest> {
|
|
42
|
-
const dir =
|
|
43
|
+
const dir = path.join(__dirname, type);
|
|
43
44
|
const statics = fs.readdirSync(dir);
|
|
44
45
|
for (const file of statics) {
|
|
45
46
|
if (file.endsWith('.sparql')) {
|
|
46
47
|
yield {
|
|
47
|
-
name: file.replace(/\.sparql
|
|
48
|
-
statics: async
|
|
48
|
+
name: file.replace(/\.sparql$/u, ''),
|
|
49
|
+
statics: async() => {
|
|
49
50
|
const query = await fsp.readFile(`${dir}/${file}`, 'utf-8');
|
|
50
51
|
return {
|
|
51
|
-
query
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
52
|
+
query,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
};
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
}
|
|
58
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@traqula/test-utils",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1-alpha.176+9400dc5",
|
|
5
|
+
"description": "Test utils used by the Traqula monorepo",
|
|
5
6
|
"lsd:module": true,
|
|
6
7
|
"license": "MIT",
|
|
7
8
|
"repository": {
|
|
@@ -16,35 +17,34 @@
|
|
|
16
17
|
"publishConfig": {
|
|
17
18
|
"access": "public"
|
|
18
19
|
},
|
|
20
|
+
"exports": {
|
|
21
|
+
"import": "./lib/index.js",
|
|
22
|
+
"require": "./lib/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"main": "lib/lexer.js",
|
|
19
25
|
"files": [
|
|
20
|
-
"lib
|
|
26
|
+
"lib/**/*.cjs",
|
|
21
27
|
"lib/**/*.d.ts",
|
|
22
28
|
"lib/**/*.js",
|
|
23
|
-
"lib/**/*.
|
|
24
|
-
"lib
|
|
29
|
+
"lib/**/*.js.map",
|
|
30
|
+
"lib/statics/**"
|
|
25
31
|
],
|
|
26
32
|
"engines": {
|
|
27
33
|
"node": ">=18.0"
|
|
28
34
|
},
|
|
29
35
|
"typings": "lib/index",
|
|
30
|
-
"type": "module",
|
|
31
|
-
"main": "lib/lexer.js",
|
|
32
|
-
"exports": {
|
|
33
|
-
"import": "./lib/index.js",
|
|
34
|
-
"require": "./lib/index.cjs"
|
|
35
|
-
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "yarn build:ts && yarn build:transpile",
|
|
38
38
|
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
|
|
39
39
|
"build:transpile": " node \"../../node_modules/esbuild/bin/esbuild\" --platform=node --format=cjs --bundle --log-level=error --outfile=lib/index.cjs lib/index.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@traqula/
|
|
42
|
+
"@traqula/rules-sparql-1-1": "^0.0.1-alpha.176+9400dc5",
|
|
43
43
|
"rdf-data-factory": "^2.0.1",
|
|
44
|
-
"vitest": "
|
|
44
|
+
"vitest": "*"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@rdfjs/types": "^2.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9400dc5f8bda1d8c2b3d1f4cf56b308995744ba0"
|
|
50
50
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|