feat: add basic tests checking the lib is not crashing
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
node_modules/
|
||||
test.js
|
||||
*.svg
|
||||
/index.js
|
||||
/without-countries.js
|
||||
|
||||
+2
-1
@@ -9,7 +9,8 @@
|
||||
},
|
||||
"module": "./src/with-countries.js",
|
||||
"scripts": {
|
||||
"build": "webpack"
|
||||
"build": "webpack",
|
||||
"test": "node test.js"
|
||||
},
|
||||
"keywords": [
|
||||
"map",
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
const DottedMap = require('./index').default;
|
||||
|
||||
// The tests can only be ran after the lib has been built.
|
||||
|
||||
const map = new DottedMap({ height: 60, grid: 'diagonal' });
|
||||
|
||||
map.addPin({
|
||||
lat: 40.73061,
|
||||
lng: -73.935242,
|
||||
svgOptions: { color: '#d6ff79', radius: 0.4 },
|
||||
});
|
||||
map.getPin({ lat: 40.73061, lng: -73.935242 });
|
||||
map.getSVG({
|
||||
radius: 0.22,
|
||||
color: '#423B38',
|
||||
shape: 'circle',
|
||||
backgroundColor: '#020300',
|
||||
});
|
||||
Reference in New Issue
Block a user