diff --git a/src/layers/__tests__/EarthEngine.spec.js b/src/layers/__tests__/EarthEngine.spec.js index 724fc187..be63a3b7 100644 --- a/src/layers/__tests__/EarthEngine.spec.js +++ b/src/layers/__tests__/EarthEngine.spec.js @@ -4,15 +4,13 @@ const urlFormat = 'https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/maps/.../tiles/{z}/{x}/{y}' // Mock out EE Worker - import.meta not supported in jest -jest.mock('../../earthengine/ee_worker_loader', () => { - class EarthEngineWorkerMock { - getTileUrl = async () => urlFormat - } - return { - __esModule: true, - default: async () => async () => EarthEngineWorkerMock, - } -}) +jest.mock('../../earthengine/ee_worker_loader', () => ({ + __esModule: true, + default: async () => async () => + new (class EarthEngineWorkerMock { + getTileUrl = async () => urlFormat + })(), +})) const token = { access_token: 'abc', @@ -101,22 +99,12 @@ describe('EarthEngine', () => { expect(layer.getId()).not.toBeNull() }) - it.only('Should add to map', async () => { - console.log('a') + it('Should add to map', async () => { const layer = new EarthEngine(options) - console.log('b') - try { - console.log(layer) - await layer.addTo(mockMap) - } catch (error) { - console.log('IT WENT WRONG', error) - } - console.log('c') + await layer.addTo(mockMap) expect(layer.getMap()).toBe(mockMap) - console.log('d') expect(layer.getMapGL()).toBe(mockMapGL) - console.log('e') await expect(layer.options.getAuthToken()).resolves.toEqual(token) })