Skip to content

Commit

Permalink
fix(operators): more readable test data
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanGerbeth committed Nov 27, 2024
1 parent 345487e commit 5edeb7c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
10 changes: 5 additions & 5 deletions packages/operators/src/request/autoPagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ describe('auto pagination', () => {
const { autoPagination } = await import('./autoPagination');

const expectedVal = {
a: { value: 'a', next: 'b' },
b: { value: 'b', next: 'c' },
c: { value: 'c', next: 'd' },
d: { value: 'd', next: 'e' },
e: { value: 'e', next: null }
a: { value: 'content a', next: 'b' },
b: { value: 'content b', next: 'c' },
c: { value: 'content c', next: 'd' },
d: { value: 'content d', next: 'e' },
e: { value: 'content e', next: null }
};

const triggerVal = {
Expand Down
20 changes: 14 additions & 6 deletions packages/operators/src/request/concurrentRequest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@ describe('concurrent request', () => {
test('default', async () => {
const { concurrentRequest } = await import('./concurrentRequest');

const expectedVal = {
a: 'content a',
b: 'content b',
c: 'content c',
d: 'content d',
e: 'content e'
};

const triggerVal = {
a: { t: 2, v: new Response('a') },
b: { t: 5, v: new Response('b') },
c: { t: 1, v: new Response('c') },
d: { t: 3, v: new Response('d') },
e: { t: 4, v: new Response('e') }
a: { t: 2, v: new Response(expectedVal.a) },
b: { t: 5, v: new Response(expectedVal.b) },
c: { t: 1, v: new Response(expectedVal.c) },
d: { t: 3, v: new Response(expectedVal.d) },
e: { t: 4, v: new Response(expectedVal.e) }
};

testScheduler.run(({ cold, expectObservable }) => {
Expand All @@ -43,7 +51,7 @@ describe('concurrent request', () => {
resolveText(),
log('operators:request:concurrent:output')
)
).toBe('---a--c-(bd)--(e|)');
).toBe('---a--c-(bd)--(e|)', expectedVal);
});
});
});
Expand Down
10 changes: 5 additions & 5 deletions packages/operators/src/request/lazyPagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ describe('lazy pagination', () => {
};

const expectedVal = {
a: { value: '1' },
b: { value: '2' },
c: { value: '3' },
d: { value: '4' },
e: { value: '5' }
a: { value: 'content a' },
b: { value: 'content b' },
c: { value: 'content c' },
d: { value: 'content d' },
e: { value: 'content e' }
};

const responseVal = {
Expand Down

0 comments on commit 5edeb7c

Please sign in to comment.