Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fcb3fe5
Convert test suite from Mocha/Chai/Sinon to Vitest, keep .js
Michiel-VandeVelde Aug 13, 2026
0e770f8
Raise test coverage on feature-webid, feature-summary views, and Quad…
Michiel-VandeVelde Aug 13, 2026
5cb1e30
Raise test coverage on feature-memento's memento view (0% -> 100%)
Michiel-VandeVelde Aug 13, 2026
f3dd32f
Add missing test coverage for core Util and UrlData
Michiel-VandeVelde Aug 13, 2026
a54c14b
Raise test coverage on core views and datasources
Michiel-VandeVelde Aug 13, 2026
9a3a70c
Raise test coverage on Datasource, SparqlDatasource, feature-qpf, and…
Michiel-VandeVelde Aug 13, 2026
bfc0d46
Cover SparqlDatasource's remaining _encodeObject/_getPatternCount bra…
Michiel-VandeVelde Aug 13, 2026
dddb598
Exclude non-source files from coverage collection to stop spurious pa…
Michiel-VandeVelde Aug 13, 2026
06a4b87
Raise test coverage on CliRunner and LinkedDataFragmentsServer
Michiel-VandeVelde Aug 13, 2026
8e626f6
Raise test coverage on LinkedDataFragmentsServerWorker (8.33% -> 95.83%)
Michiel-VandeVelde Aug 13, 2026
5d4f48c
Close remaining reachable branch gaps across core, datasource-n3/rdfa,
Michiel-VandeVelde Aug 13, 2026
9adbdc6
Close remaining branches on Datasource and QuadPatternFragmentsContro…
Michiel-VandeVelde Aug 13, 2026
c5c379f
Test the message-defaulting branch in createErrorType's ErrorType
Michiel-VandeVelde Aug 13, 2026
760382d
Fix qejs/HtmlView render hang under Vitest, un-skip NotFoundControlle…
Michiel-VandeVelde Aug 19, 2026
0bc7e15
Raise test coverage across CliRunner, LinkedDataFragmentsServer(Worke…
Michiel-VandeVelde Aug 20, 2026
168d194
Trim explanatory comments to essentials, mark known bugs as TODOs
Michiel-VandeVelde Aug 21, 2026
f047fd0
Fix N3ParserExtended rename, document TimegateController/SummaryHtmlV…
Michiel-VandeVelde Aug 21, 2026
96b941a
Replace sinon with vitest's native mocking across the test suite
Michiel-VandeVelde Aug 24, 2026
e32b0a6
Remove stale engines field from @ldf/core
Michiel-VandeVelde Aug 24, 2026
d0b9fd1
Add eslint-plugin-promise to push test files toward async/await
Michiel-VandeVelde Aug 24, 2026
287bfad
Return runCustom's internal promise instead of void
Michiel-VandeVelde Aug 24, 2026
0981bd3
Convert test suite promise handling to async/await
Michiel-VandeVelde Aug 24, 2026
7a0c5dd
Replace Promise.withResolvers() with a Node 20-compatible helper
Michiel-VandeVelde Aug 24, 2026
85ca1b4
Add the missing eslint-plugin-promise devDependency
Michiel-VandeVelde Aug 24, 2026
005268c
remove unnecessary added tests
Michiel-VandeVelde Aug 26, 2026
f5fb273
adress bindings feedback
Michiel-VandeVelde Aug 26, 2026
7da94df
Replace util.promisify with the existing withResolvers helper
Michiel-VandeVelde Aug 26, 2026
64047b5
Replace WithResolvers with await new Promise((resolve) => instance.cl…
Michiel-VandeVelde Aug 27, 2026
2eab86e
Replace remaining Promise.race and withResolvers usage with plain Pro…
Michiel-VandeVelde Aug 27, 2026
e3c8464
Update packages/core/test/datasources/Datasource-test.js
Michiel-VandeVelde Aug 28, 2026
85909f3
Update test/test-helpers.js
Michiel-VandeVelde Aug 28, 2026
e6b5351
Update test/test-helpers.js
Michiel-VandeVelde Aug 28, 2026
724c883
Fix streamLength: invalid TS syntax and missing import in a plain JS …
Michiel-VandeVelde Aug 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,11 @@
{
// Specific rules for test files
files: [ "packages/**/test/**/*-test.js" ],
plugins: [ "eslint-plugin-promise" ],
rules: {
"import/no-extraneous-dependencies": "off"
"import/no-extraneous-dependencies": "off",
"promise/prefer-await-to-then": 2,
"promise/prefer-await-to-callbacks": 2
}
},
{
Expand Down
17 changes: 7 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@
"@types/request": "^2.48.13",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"chai": "^4.0.0",
"@vitest/coverage-v8": "^4.1.10",
"coveralls": "^3.0.9",
"eslint": "^7.0.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-promise": "^7.3.0",
"lerna": "^4.0.0",
"manual-git-changelog": "^1.0.1",
"mocha": "^8.0.0",
"node-gyp": "^11.0.0",
"nyc": "^15.0.0",
"pre-commit": "^1.1.3",
"rdf-object": "^1.14.0",
"sinon": "^1.17.4",
"sinon-chai": "^2.14.0",
"supertest": "^6.0.0",
"typescript": "^5.9.3"
"typescript": "^5.9.3",
"vitest": "^4.1.10"
},
"pre-commit": [
"lint",
Expand All @@ -37,12 +35,11 @@
"scripts": {
"test-changed": "lerna run test --since HEAD",
"lint-changed": "lerna run lint --since HEAD",
"mocha": "mocha \"packages/*/test/**/*-test.js\" --recursive --require ./test/test-setup --timeout 500",
"test": "nyc npm run mocha",
"test-ci": "nyc --reporter=lcov npm run mocha",
"test": "vitest run --coverage",
"test-ci": "vitest run --coverage",
"typecheck": "tsc -p tsconfig.json --noEmit",
"build": "tsc -p tsconfig.json",
"lint": "eslint packages/*/bin/* packages/*/lib packages/*/test --ext .js,.ts",
"lint": "eslint packages/*/bin/* packages/*/lib packages/*/test test --ext .js,.ts",
"clean": "rm -rf ./node_modules && rm -rf ./packages/*/node_modules",
"dedupe": "npx yarn-deduplicate yarn.lock --scopes",
"publish": "lerna publish",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/lib/CliRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import type { WorkerConfig } from './types';
type Writable = { write(chunk: string): void };

// Run function for starting the server from the command line
export function runCli(moduleRootPath: string): void {
export function runCli(moduleRootPath: string): Promise<void> {
let argv = process.argv.slice(2);
runCustom(argv, process.stdin, process.stdout, process.stderr, null, { mainModulePath: moduleRootPath });
return runCustom(argv, process.stdin, process.stdout, process.stderr, null, { mainModulePath: moduleRootPath });
}

// Generic run function for starting the server from a given config
Expand All @@ -29,7 +29,7 @@ export function runCustom(
stderr: Writable,
componentConfigUri: string | null,
properties: Record<string, any>,
): void {
): Promise<void> {
if (args.length < 1 || args.length > 4 || /^--?h(elp)?$/.test(args[0])) {
stdout.write('usage: server config.json [port [workers [componentConfigUri]]]\n');
return process.exit(1);
Expand All @@ -39,7 +39,7 @@ export function runCustom(
cliWorkers = parseInt(args[2], 10),
configUri = args[3] || componentConfigUri || 'urn:ldf-server:my';

ComponentsManager.build<LinkedDataFragmentsServerWorker>({
return ComponentsManager.build<LinkedDataFragmentsServerWorker>({
...properties,
configLoader: (registry: ConfigRegistry) => registry.register(args[0]),
} as IComponentsManagerBuilderOptions<LinkedDataFragmentsServerWorker>)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/UrlData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class UrlData {
options = options || {};
this.baseURL = (options.baseURL || '/').replace(/\/?$/, '/');
this.baseURLRoot = this.baseURL.match(/^(?:https?:\/\/[^\/]+)?/)![0];
this.baseURLPath = this.baseURL.substr(this.baseURLRoot.length);
this.baseURLPath = this.baseURL.slice(this.baseURLRoot.length);
this.blankNodePath = this.baseURLRoot ? '/.well-known/genid/' : '';
this.blankNodePrefix = this.blankNodePath ? this.baseURLRoot + this.blankNodePath : 'genid:';
this.blankNodePrefixLength = this.blankNodePrefix.length;
Expand Down
8 changes: 4 additions & 4 deletions packages/core/lib/datasources/Datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ export class Datasource extends EventEmitter {
// Translate blank nodes IRIs in the query to blank nodes
let blankNodePrefix = this.urlData.blankNodePrefix, blankNodePrefixLength = this.urlData.blankNodePrefixLength;
if (query.subject && query.subject.termType === 'NamedNode' && query.subject.value.indexOf(blankNodePrefix) === 0)
query.subject = this.dataFactory.blankNode(query.subject.value.substr(blankNodePrefixLength));
query.subject = this.dataFactory.blankNode(query.subject.value.slice(blankNodePrefixLength));
if (query.object && query.object.termType === 'NamedNode' && query.object.value.indexOf(blankNodePrefix) === 0)
query.object = this.dataFactory.blankNode(query.object.value.substr(blankNodePrefixLength));
query.object = this.dataFactory.blankNode(query.object.value.slice(blankNodePrefixLength));
if (query.graph && query.graph.termType === 'NamedNode' && query.graph.value.indexOf(blankNodePrefix) === 0)
query.graph = this.dataFactory.blankNode(query.graph.value.substr(blankNodePrefixLength));
query.graph = this.dataFactory.blankNode(query.graph.value.slice(blankNodePrefixLength));

// Force the default graph if QPF support is disable
if (!this._supportsQuads)
Expand Down Expand Up @@ -214,7 +214,7 @@ export class Datasource extends EventEmitter {
break;
// Read a file from the local filesystem
case 'file':
stream = fs.createReadStream(url.substr(protocolMatch[0].length), { encoding: 'utf8' });
stream = fs.createReadStream(url.slice(protocolMatch[0].length), { encoding: 'utf8' });
break;
default:
stream = new EventEmitter();
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/routers/DatasourceRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class DatasourceRouter {
extractQueryParams(request: RouterRequest, query: Query): void {
(query.features || (query.features = {})).datasource = true;
let path = request.url && request.url.pathname || '/';
query.datasource = path.substr(this._baseLength);
query.datasource = path.slice(this._baseLength);
}
}

3 changes: 0 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
"test": "nyc mocha",
"lint": "eslint bin/* lib test"
},
"engines": {
"node": ">=10.0"
},
"dependencies": {
"asynciterator": "^3.0.0",
"componentsjs": "^4.0.4",
Expand Down
Loading