test: clean up internal testing utilities (#42177)

We have some internal proxies for all of the Jasmine functions, as well as some other helpers. This code hasn't been touched in more than 5 years, it can lead to confusion and it isn't really necessary since the same can be achieved using Jasmine.

These changes remove most of the code and clean up our existing unit tests.

PR Close #42177
This commit is contained in:
Kristiyan Kostadinov
2021-05-23 22:16:02 +02:00
committed by Zach Arend
parent bd51762d6e
commit a787f78074
81 changed files with 2086 additions and 2885 deletions
@@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
import {AsyncTestCompleter, beforeEach, describe, expect, inject, it} from '@angular/core/testing/src/testing_internal';
import {ResourceLoaderImpl} from '@angular/platform-browser-dynamic/src/resource_loader/resource_loader_impl';
if (isBrowser) {
@@ -26,21 +25,19 @@ if (isBrowser) {
resourceLoader = new ResourceLoaderImpl();
});
it('should resolve the Promise with the file content on success',
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
resourceLoader.get(url200).then((text) => {
expect(text.trim()).toEqual('<p>hey</p>');
async.done();
});
}), 10000);
it('should resolve the Promise with the file content on success', done => {
resourceLoader.get(url200).then((text) => {
expect(text.trim()).toEqual('<p>hey</p>');
done();
});
}, 10000);
it('should reject the Promise on failure',
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
resourceLoader.get(url404).catch((e) => {
expect(e).toEqual(`Failed to load ${url404}`);
async.done();
return null;
});
}), 10000);
it('should reject the Promise on failure', done => {
resourceLoader.get(url404).catch((e) => {
expect(e).toEqual(`Failed to load ${url404}`);
done();
return null;
});
}, 10000);
});
}