Skip to content

Commit 894497f

Browse files
[fix]UT
1 parent f56b3df commit 894497f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/mapboxgl/core/MapExtendSpec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { FetchRequest } from '../../../src/common/util/FetchRequest';
44
import cipher from 'node-forge/lib/cipher';
55
import { MapExtend } from '../../../src/mapboxgl/core/MapExtend';
66
import { decryptSources } from '../../../src/mapboxgl/core/decryptSource';
7+
import { EncryptRequest } from '../../../src/common/util/EncryptRequest';
78

89
describe('getServiceKey', () => {
910
let originalTimeout;
@@ -170,6 +171,15 @@ describe('getServiceKey', () => {
170171
});
171172

172173
it('getServiceKey', async () => {
174+
EncryptRequest.prototype.request = () => {
175+
return {
176+
json: () =>
177+
new Promise((resolve) => {
178+
resolve('P8h08GonNjuCB4+CAykAGmLYwNsiv4G6H8KFrFi7Afk=');
179+
})
180+
};
181+
};
182+
173183
try {
174184
const source = {
175185
tiles: [

0 commit comments

Comments
 (0)