1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

Bump node to 14 (#358)

* Bump node requirement to 14 and npm to 7
This commit is contained in:
Oscar Hinton
2021-05-12 18:55:00 +02:00
committed by GitHub
parent 1e2c56cacf
commit ba1a40af4e
4 changed files with 158 additions and 177 deletions

View File

@@ -1,4 +1,4 @@
import * as TypeMoq from 'typemoq';
import Substitute from '@fluffy-spoon/substitute';
import { PlatformUtilsService } from '../../../src/abstractions/platformUtils.service';
@@ -467,11 +467,12 @@ function testRsaGenerateKeyPair(length: 1024 | 2048 | 4096) {
}
function getWebCryptoFunctionService() {
const platformUtilsMock = TypeMoq.Mock.ofType<PlatformUtilsService>(PlatformUtilsServiceMock);
platformUtilsMock.setup(x => x.isEdge()).returns(() => navigator.userAgent.indexOf(' Edg/') !== -1);
platformUtilsMock.setup(x => x.isIE()).returns(() => navigator.userAgent.indexOf(' Edg/') === -1 &&
const platformUtilsMock = Substitute.for<PlatformUtilsService>();
platformUtilsMock.isEdge().mimicks(() => navigator.userAgent.indexOf(' Edg/') !== -1);
platformUtilsMock.isIE().mimicks(() => navigator.userAgent.indexOf(' Edg/') === -1 &&
navigator.userAgent.indexOf(' Trident/') !== -1);
return new WebCryptoFunctionService(window, platformUtilsMock.object);
return new WebCryptoFunctionService(window, platformUtilsMock);
}
function makeStaticByteArray(length: number) {
@@ -481,9 +482,3 @@ function makeStaticByteArray(length: number) {
}
return arr;
}
class PlatformUtilsServiceMock extends PlatformUtilsService {
isEdge = () => false;
isIE = () => false;
isSafari = () => super.isSafari();
}