Skip to content

Commit

Permalink
test: Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Jul 10, 2024
1 parent e2f184a commit 0535ee6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/iterator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {fileURLToPath} from 'url';
import removeDirectory from '../src/utils/removeDir.js';
import {NamedNode} from '@rdfjs/types';
import getSPARQLQuery from '../src/utils/getSPARQLQuery.js';
import getEndpoint from '../src/utils/getEndpoint.js';
chai.use(chaiAsPromised);

describe('Iterator Class', () => {
Expand Down Expand Up @@ -57,8 +58,10 @@ describe('Iterator Class', () => {
};
const pipeline = new Pipeline(configuration, {silent: true});
const stageConfig = configuration.stages[0];
const stage = new Stage(pipeline, stageConfig);
const iterator = new Iterator(stage);
const iterator = new Iterator(
Query.from(getSPARQLQuery(stageConfig.iterator.query, 'select')),
getEndpoint(new Stage(pipeline, stageConfig))
);
chai.expect(iterator).to.be.an.instanceOf(Iterator);
chai.expect(iterator).to.be.an.instanceOf(EventEmitter);
chai.expect(iterator).to.have.property('query');
Expand All @@ -68,7 +71,7 @@ describe('Iterator Class', () => {
chai.expect(iterator).to.have.property('totalResults', 0);
});
});
describe.skip('run', () => {
describe('run', () => {
it('should emit "data" and "end" events with the correct $this and numResults', async () => {
const configuration: Configuration = {
name: 'Example Pipeline',
Expand Down Expand Up @@ -104,8 +107,10 @@ describe('Iterator Class', () => {
};
const pipeline = new Pipeline(configuration, {silent: true});
const stageConfig = configuration.stages[0];
const stage = new Stage(pipeline, stageConfig);
const iterator = new Iterator(stage);
const iterator = new Iterator(
Query.from(getSPARQLQuery(stageConfig.iterator.query, 'select')),
getEndpoint(new Stage(pipeline, stageConfig))
);
const emittedEvents: {event: string; bindings?: NamedNode}[] = [];
async function runIteratorWithPromise(): Promise<boolean> {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 0535ee6

Please sign in to comment.