Use non-deprecated TestPipeline static methods
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
+1
-1
@@ -142,7 +142,7 @@ describe('DefaultCatalogCollatorFactory', () => {
|
||||
});
|
||||
|
||||
const collator = await factory.getCollator();
|
||||
const pipeline = TestPipeline.withSubject(collator);
|
||||
const pipeline = TestPipeline.fromCollator(collator);
|
||||
const { documents } = await pipeline.execute();
|
||||
|
||||
expect(documents).toHaveLength(2);
|
||||
|
||||
@@ -381,7 +381,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -412,7 +412,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -452,7 +452,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -495,7 +495,7 @@ describe('LunrSearchEngine', () => {
|
||||
inspectableSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -544,7 +544,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -583,7 +583,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -623,7 +623,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -663,7 +663,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -708,7 +708,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -763,10 +763,10 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index-2',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer1)
|
||||
await TestPipeline.fromIndexer(indexer1)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
await TestPipeline.withSubject(indexer2)
|
||||
await TestPipeline.fromIndexer(indexer2)
|
||||
.withDocuments(mockDocuments2)
|
||||
.execute();
|
||||
|
||||
@@ -811,7 +811,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -871,14 +871,14 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
const indexer2 = await getActualIndexer(
|
||||
testLunrSearchEngine,
|
||||
'test-index-2',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer2)
|
||||
await TestPipeline.fromIndexer(indexer2)
|
||||
.withDocuments(mockDocuments2)
|
||||
.execute();
|
||||
|
||||
@@ -924,7 +924,7 @@ describe('LunrSearchEngine', () => {
|
||||
testLunrSearchEngine,
|
||||
'test-index',
|
||||
);
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -974,7 +974,7 @@ describe('LunrSearchEngine', () => {
|
||||
}));
|
||||
|
||||
const indexer = await getActualIndexer(testLunrSearchEngine, 'test-index');
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -1112,7 +1112,7 @@ describe('stopword testing', () => {
|
||||
|
||||
const indexer = await getActualIndexer(testLunrSearchEngine, 'test-index');
|
||||
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -1149,7 +1149,7 @@ describe('stopword testing', () => {
|
||||
|
||||
const indexer = await getActualIndexer(testLunrSearchEngine, 'test-index');
|
||||
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
@@ -1186,7 +1186,7 @@ describe('stopword testing', () => {
|
||||
|
||||
const indexer = await getActualIndexer(testLunrSearchEngine, 'test-index');
|
||||
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments(mockDocuments)
|
||||
.execute();
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ describe('LunrSearchEngineIndexer', () => {
|
||||
},
|
||||
];
|
||||
|
||||
await TestPipeline.withSubject(indexer).withDocuments(documents).execute();
|
||||
await TestPipeline.fromIndexer(indexer).withDocuments(documents).execute();
|
||||
|
||||
expect(lunrBuilderAddSpy).toHaveBeenCalledWith(documents[0]);
|
||||
});
|
||||
@@ -70,7 +70,7 @@ describe('LunrSearchEngineIndexer', () => {
|
||||
location: `location-${i}`,
|
||||
}));
|
||||
|
||||
await TestPipeline.withSubject(indexer).withDocuments(documents).execute();
|
||||
await TestPipeline.fromIndexer(indexer).withDocuments(documents).execute();
|
||||
expect(lunrBuilderAddSpy).toHaveBeenCalledTimes(350);
|
||||
});
|
||||
|
||||
@@ -84,7 +84,7 @@ describe('LunrSearchEngineIndexer', () => {
|
||||
},
|
||||
];
|
||||
|
||||
await TestPipeline.withSubject(indexer).withDocuments(documents).execute();
|
||||
await TestPipeline.fromIndexer(indexer).withDocuments(documents).execute();
|
||||
|
||||
// Builder ref should be set to location (and only once).
|
||||
expect(lunrBuilderRefSpy).toHaveBeenCalledTimes(1);
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('BatchSearchEngineIndexer', () => {
|
||||
|
||||
it('should work end-to-end', async () => {
|
||||
const indexer = new ConcreteBatchIndexer({ batchSize: 1 });
|
||||
await TestPipeline.withSubject(indexer)
|
||||
await TestPipeline.fromIndexer(indexer)
|
||||
.withDocuments([document, document, document])
|
||||
.execute();
|
||||
expect(indexSpy).toHaveBeenCalledTimes(3);
|
||||
|
||||
@@ -54,7 +54,7 @@ describe('DecoratorBase', () => {
|
||||
}));
|
||||
|
||||
const decorator = new ConcreteDecorator();
|
||||
const { documents } = await TestPipeline.withSubject(decorator)
|
||||
const { documents } = await TestPipeline.fromDecorator(decorator)
|
||||
.withDocuments([document, document, document])
|
||||
.execute();
|
||||
|
||||
@@ -68,7 +68,7 @@ describe('DecoratorBase', () => {
|
||||
decorateSpy.mockResolvedValue(undefined);
|
||||
|
||||
const decorator = new ConcreteDecorator();
|
||||
const { documents } = await TestPipeline.withSubject(decorator)
|
||||
const { documents } = await TestPipeline.fromDecorator(decorator)
|
||||
.withDocuments([document, document, document])
|
||||
.execute();
|
||||
|
||||
@@ -82,7 +82,7 @@ describe('DecoratorBase', () => {
|
||||
});
|
||||
|
||||
const decorator = new ConcreteDecorator();
|
||||
const { documents } = await TestPipeline.withSubject(decorator)
|
||||
const { documents } = await TestPipeline.fromDecorator(decorator)
|
||||
.withDocuments([document, document, document])
|
||||
.execute();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user