Skip to content

Commit

Permalink
test: tests not exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximvdw committed Nov 20, 2024
1 parent 8746e3a commit a66d5bc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
16 changes: 10 additions & 6 deletions src/common/SolidDataDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,16 @@ export class SolidDataDriver<T extends DataObject | DataFrame> 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,
},
);
});
}

Expand Down
4 changes: 4 additions & 0 deletions src/common/SolidPropertyService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export class SolidPropertyService extends DataService<string, any> {
}),
);
this.filter = filter ?? defaultFilter;

this.once('destroy', () => {
this.driver.emit('destroy');
});
}

set service(service: SolidService) {
Expand Down
11 changes: 4 additions & 7 deletions src/node/SolidPropertySink.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -27,9 +27,7 @@ export class SolidPropertySink<Out extends DataFrame> extends SinkNode<Out> {
}

protected prepareProperty(session: SolidSession): Promise<void> {
return new Promise<void>((resolve, reject) => {

});
return new Promise<void>((resolve, reject) => {});
}

protected writeProperty(frame: Out): Promise<void> {
Expand All @@ -41,7 +39,6 @@ export class SolidPropertySink<Out extends DataFrame> extends SinkNode<Out> {
const position = dataObject.getPosition();
if (position) {
// Write position to Solid pod

}
} else if (property === PropertyType.VELOCITY) {
// Write velocity
Expand Down
3 changes: 2 additions & 1 deletion test/.mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"spec": "test/specs/**/*.spec.ts",
"slow": 1500,
"timeout": 20000,
"recursive": true
"recursive": true,
"exit": true
}
4 changes: 3 additions & 1 deletion test/specs/solid.property.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit a66d5bc

Please sign in to comment.