build: update jasmine to 3.5 (#34625)

1. update jasmine to 3.5
2. update @types/jasmine to 3.5
3. update @types/jasminewd2 to 2.0.8

Also fix several cases, the new jasmine 3 will help to create test cases correctly,
such as in the `jasmine 2.x` version, the following case will pass

```
expect(1 == 2);
```

But in jsamine 3, the case will need to be

```
expect(1 == 2).toBeTrue();
```

PR Close #34625
This commit is contained in:
JiaLiPassion
2020-01-03 14:28:06 +09:00
committed by Kara Erickson
parent db4a448439
commit ef4736d052
29 changed files with 124 additions and 85 deletions

View File

@ -179,12 +179,12 @@ import {MockPushManager, MockPushSubscription, MockServiceWorkerContainer, MockS
expect(pmSubscribeSpy).toHaveBeenCalledTimes(1);
expect(pmSubscribeSpy).toHaveBeenCalledWith({
applicationServerKey: jasmine.any(Uint8Array),
applicationServerKey: jasmine.any(Uint8Array) as any,
userVisibleOnly: true,
});
const actualAppServerKey = pmSubscribeSpy.calls.first().args[0].applicationServerKey;
const actualAppServerKeyStr = decode(actualAppServerKey);
const actualAppServerKey = pmSubscribeSpy.calls.first().args[0] !.applicationServerKey;
const actualAppServerKeyStr = decode(actualAppServerKey as Uint8Array);
expect(actualAppServerKeyStr).toBe(appServerKeyStr);
});

View File

@ -30,7 +30,7 @@ describe('ServiceWorkerModule', () => {
beforeEach(
() => swRegisterSpy =
spyOn(navigator.serviceWorker, 'register').and.returnValue(Promise.resolve()));
spyOn(navigator.serviceWorker, 'register').and.returnValue(Promise.resolve(null as any)));
describe('register()', () => {
const configTestBed = async(opts: SwRegistrationOptions) => {