refactor(compiler): allow sync AOT compilation (#16832).
AOT compilation can be executed synchronously now, if the `ReosurceLoader` returns a string directly (and no `Promise`).
This commit is contained in:

committed by
Chuck Jazdzewski

parent
255d7226d1
commit
5af143e8e4
@ -7,18 +7,10 @@
|
||||
*/
|
||||
|
||||
import {fakeAsync} from '@angular/core/testing/src/fake_async';
|
||||
import {SyncAsyncResult, escapeRegExp, splitAtColon, utf8Encode} from '../src/util';
|
||||
import {SyncAsync, escapeRegExp, splitAtColon, utf8Encode} from '../src/util';
|
||||
|
||||
export function main() {
|
||||
describe('util', () => {
|
||||
describe('SyncAsyncResult', () => {
|
||||
it('async value should default to Promise.resolve(syncValue)', fakeAsync(() => {
|
||||
const syncValue = {};
|
||||
const sar = new SyncAsyncResult(syncValue);
|
||||
sar.asyncResult !.then((v: any) => expect(v).toBe(syncValue));
|
||||
}));
|
||||
});
|
||||
|
||||
describe('splitAtColon', () => {
|
||||
it('should split when a single ":" is present', () => {
|
||||
expect(splitAtColon('a:b', [])).toEqual(['a', 'b']);
|
||||
|
Reference in New Issue
Block a user