diff --git a/.gitignore b/.gitignore index 180354f..20ed762 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ node_modules/ -test.js *.svg /index.js /without-countries.js diff --git a/package.json b/package.json index e448291..e844aa1 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ }, "module": "./src/with-countries.js", "scripts": { - "build": "webpack" + "build": "webpack", + "test": "node test.js" }, "keywords": [ "map", diff --git a/test.js b/test.js new file mode 100644 index 0000000..a738380 --- /dev/null +++ b/test.js @@ -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', +});