Chore: more any/type assertion improvements (#57450)

* more friday any/type assertion improvements

* Apply suggestions from code review

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* Update public/app/angular/promiseToDigest.test.ts

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
This commit is contained in:
Ashley Harrison
2022-10-25 11:04:35 +02:00
committed by GitHub
co-authored by Marcus Andersson
parent 8adbacb18e
commit d2a70bc42d
47 changed files with 164 additions and 389 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import { promiseToDigest } from './promiseToDigest';
describe('promiseToDigest', () => {
describe('when called with a promise that resolves', () => {
it('then evalAsync should be called on $scope', async () => {
const $scope: IScope = { $evalAsync: jest.fn() } as any as IScope;
const $scope = { $evalAsync: jest.fn() } as jest.MockedObject<IScope>;
await promiseToDigest($scope)(Promise.resolve(123));
@@ -15,7 +15,7 @@ describe('promiseToDigest', () => {
describe('when called with a promise that rejects', () => {
it('then evalAsync should be called on $scope', async () => {
const $scope: IScope = { $evalAsync: jest.fn() } as any as IScope;
const $scope = { $evalAsync: jest.fn() } as jest.MockedObject<IScope>;
try {
await promiseToDigest($scope)(Promise.reject(123));