Skip to content

Commit a787f78

Browse files
crisbetozarend
authored andcommitted
test: clean up internal testing utilities (angular#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 angular#42177
1 parent bd51762 commit a787f78

File tree

81 files changed

+2150
-2949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2150
-2949
lines changed

packages/benchpress/test/metric/multi_metric_spec.ts

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {AsyncTestCompleter, describe, expect, inject, it} from '@angular/core/testing/src/testing_internal';
10-
119
import {Injector, Metric, MultiMetric} from '../../index';
1210

1311
(function() {
@@ -22,29 +20,27 @@ function createMetric(ids: any[]) {
2220
}
2321

2422
describe('multi metric', () => {
25-
it('should merge descriptions', inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
26-
createMetric(['m1', 'm2']).then((m) => {
27-
expect(m.describe()).toEqual({'m1': 'describe', 'm2': 'describe'});
28-
async.done();
29-
});
30-
}));
23+
it('should merge descriptions', done => {
24+
createMetric(['m1', 'm2']).then((m) => {
25+
expect(m.describe()).toEqual({'m1': 'describe', 'm2': 'describe'});
26+
done();
27+
});
28+
});
3129

32-
it('should merge all beginMeasure calls',
33-
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
34-
createMetric(['m1', 'm2']).then((m) => m.beginMeasure()).then((values) => {
35-
expect(values).toEqual(['m1_beginMeasure', 'm2_beginMeasure']);
36-
async.done();
37-
});
38-
}));
30+
it('should merge all beginMeasure calls', done => {
31+
createMetric(['m1', 'm2']).then((m) => m.beginMeasure()).then((values) => {
32+
expect(values).toEqual(['m1_beginMeasure', 'm2_beginMeasure']);
33+
done();
34+
});
35+
});
3936

4037
[false, true].forEach((restartFlag) => {
41-
it(`should merge all endMeasure calls for restart=${restartFlag}`,
42-
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
43-
createMetric(['m1', 'm2']).then((m) => m.endMeasure(restartFlag)).then((values) => {
44-
expect(values).toEqual({'m1': {'restart': restartFlag}, 'm2': {'restart': restartFlag}});
45-
async.done();
46-
});
47-
}));
38+
it(`should merge all endMeasure calls for restart=${restartFlag}`, done => {
39+
createMetric(['m1', 'm2']).then((m) => m.endMeasure(restartFlag)).then((values) => {
40+
expect(values).toEqual({'m1': {'restart': restartFlag}, 'm2': {'restart': restartFlag}});
41+
done();
42+
});
43+
});
4844
});
4945
});
5046
})();

0 commit comments

Comments
 (0)