angular-docs-cn/aio/content/examples/rx-library/src/simple-creation.1.spec.ts
Kristiyan Kostadinov e86a1d3441 docs: make all examples compatible with strict mode (#41999)
Turns on the `strict` compiler flag and resolves the compilation errors in the various AIO examples.

PR Close #41999
2021-05-17 10:42:18 -07:00

15 lines
473 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 consoleSpy = jasmine.createSpyObj<Console>('console', ['log']);
const fetch = () => of({foo: 42});
docRegionPromise(consoleSpy, fetch);
expect(consoleSpy.log.calls.allArgs()).toEqual([
[{foo: 42}],
['Completed'],
]);
});
});