mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
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:
co-authored by
Marcus Andersson
parent
8adbacb18e
commit
d2a70bc42d
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user