diff --git a/src/common/SolidDataDriver.ts b/src/common/SolidDataDriver.ts index ea6f259..a3f15dc 100644 --- a/src/common/SolidDataDriver.ts +++ b/src/common/SolidDataDriver.ts @@ -114,12 +114,16 @@ export class SolidDataDriver extends SPARQLDat const subjects = Object.values(dataset.graphs.default); const quads = RDFSerializer.subjectsToQuads(subjects); const store = new Store(quads); - return super.findAll(query.query, { - ...options, - }, { - sources: [store], - lenient: true, - }); + return super.findAll( + query.query, + { + ...options, + }, + { + sources: [store], + lenient: true, + }, + ); }); } diff --git a/src/common/SolidPropertyService.ts b/src/common/SolidPropertyService.ts index 4a3750e..7604af4 100644 --- a/src/common/SolidPropertyService.ts +++ b/src/common/SolidPropertyService.ts @@ -50,6 +50,10 @@ export class SolidPropertyService extends DataService { }), ); this.filter = filter ?? defaultFilter; + + this.once('destroy', () => { + this.driver.emit('destroy'); + }); } set service(service: SolidService) { diff --git a/src/node/SolidPropertySink.ts b/src/node/SolidPropertySink.ts index 540c52d..77c857e 100644 --- a/src/node/SolidPropertySink.ts +++ b/src/node/SolidPropertySink.ts @@ -1,6 +1,6 @@ -import { DataFrame, PushOptions, SinkNode, SinkNodeOptions } from "@openhps/core"; -import { Property } from "@openhps/rdf"; -import { SolidSession } from "../common"; +import { DataFrame, PushOptions, SinkNode, SinkNodeOptions } from '@openhps/core'; +import { Property } from '@openhps/rdf'; +import { SolidSession } from '../common'; /** * Solid property sink is a sink node that writes data to a Solid pod. @@ -27,9 +27,7 @@ export class SolidPropertySink extends SinkNode { } protected prepareProperty(session: SolidSession): Promise { - return new Promise((resolve, reject) => { - - }); + return new Promise((resolve, reject) => {}); } protected writeProperty(frame: Out): Promise { @@ -41,7 +39,6 @@ export class SolidPropertySink extends SinkNode { const position = dataObject.getPosition(); if (position) { // Write position to Solid pod - } } else if (property === PropertyType.VELOCITY) { // Write velocity diff --git a/test/.mocharc.json b/test/.mocharc.json index 7c6ac49..a1f4de4 100644 --- a/test/.mocharc.json +++ b/test/.mocharc.json @@ -10,5 +10,6 @@ "spec": "test/specs/**/*.spec.ts", "slow": 1500, "timeout": 20000, - "recursive": true + "recursive": true, + "exit": true } \ No newline at end of file diff --git a/test/specs/solid.property.service.spec.ts b/test/specs/solid.property.service.spec.ts index cc77833..bac36c8 100644 --- a/test/specs/solid.property.service.spec.ts +++ b/test/specs/solid.property.service.spec.ts @@ -31,6 +31,8 @@ describe('SolidPropertyService', () => { after((done) => { service.service.deleteRecursively(session, "https://solid.maximvdw.be/properties/test/").then(() => { return clientService.logout(session); + }).then(() => { + return Promise.all([service.emitAsync('destroy'), clientService.emitAsync('destroy')]); }).then(() => { done(); }).catch(done); @@ -103,7 +105,7 @@ describe('SolidPropertyService', () => { } done(); })().catch(done); - }); + }).timeout(60000); it('should be able to fetch multiple observations', (done) => { const property = new Property("https://solid.maximvdw.be/properties/test");