This commit adds missing unit tests for all rx-library examples from the docs. Closes #28017 PR Close #38905
15 lines
446 B
TypeScript
15 lines
446 B
TypeScript
import { of } from 'rxjs';
|
|
import { docRegionPromise } from './simple-creation.1';
|
|
|
|
describe('simple-creation.1', () => {
|
|
it('should create a promise from an observable and return an empty object', () => {
|
|
const console = {log: jasmine.createSpy('log')};
|
|
const fetch = () => of({foo: 42});
|
|
docRegionPromise(console, fetch);
|
|
expect(console.log.calls.allArgs()).toEqual([
|
|
[{foo: 42}],
|
|
['Completed'],
|
|
]);
|
|
});
|
|
});
|