diff --git a/.ocularrc.js b/.ocularrc.js
index 3b01ff28e..4d36f2eb0 100644
--- a/.ocularrc.js
+++ b/.ocularrc.js
@@ -13,6 +13,9 @@ export default {
'react-map-gl/test': resolve('./test'),
'react-map-gl': resolve('./src')
},
+ nodeAliases: {
+ 'react-dom': resolve('./test/src/utils/react-dom-mock.js')
+ },
browserTest: {
server: {wait: 5000}
diff --git a/package.json b/package.json
index 6095cf80b..9ff696d49 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,7 @@
"README.md"
],
"scripts": {
- "typecheck": "tsc -p tsconfig.esm.json --noEmit",
+ "typecheck": "tsc -p tsconfig.build.json --noEmit",
"bootstrap": "PUPPETEER_SKIP_DOWNLOAD=true yarn && ocular-bootstrap",
"build": "ocular-clean && ocular-build",
"lint": "ocular-lint",
diff --git a/test/node.js b/test/node.js
index 9b8157549..ed67e839a 100644
--- a/test/node.js
+++ b/test/node.js
@@ -1,7 +1,7 @@
-const {JSDOM} = require('jsdom');
+import {JSDOM} from 'jsdom';
const dom = new JSDOM(`
`);
/* global global */
global.document = dom.window.document;
-require('./src');
+import './src';
diff --git a/test/src/components/map.spec.jsx b/test/src/components/map.spec.jsx
index 3b5037e77..4ecb772d2 100644
--- a/test/src/components/map.spec.jsx
+++ b/test/src/components/map.spec.jsx
@@ -107,14 +107,13 @@ test('Map#controlled#no-update', async t => {
});
});
-test('Map#controlled#mirrow-back', async t => {
- t.plan(5);
+test('Map#controlled#mirror-back', async t => {
+ t.plan(6);
const mapRef = {current: null};
- let lastLat;
- function onRender(e) {
+ function onRender(viewState) {
const {lat} = mapRef.current.getCenter();
- t.is(lat, lastLat, `latitude should match state: ${lat}`);
+ t.is(lat, viewState.latitude, `latitude should match state: ${lat}`);
}
function App() {
@@ -124,8 +123,6 @@ test('Map#controlled#mirrow-back', async t => {
zoom: 4
});
- lastLat = viewState.latitude;
-
return (