feat: add basic tests checking the lib is not crashing

This commit is contained in:
Basile Bruneau
2022-02-13 17:49:11 +01:00
parent 1ee4354b9e
commit 411e58185e
3 changed files with 20 additions and 2 deletions
-1
View File
@@ -1,5 +1,4 @@
node_modules/ node_modules/
test.js
*.svg *.svg
/index.js /index.js
/without-countries.js /without-countries.js
+2 -1
View File
@@ -9,7 +9,8 @@
}, },
"module": "./src/with-countries.js", "module": "./src/with-countries.js",
"scripts": { "scripts": {
"build": "webpack" "build": "webpack",
"test": "node test.js"
}, },
"keywords": [ "keywords": [
"map", "map",
+18
View File
@@ -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',
});