Loading app/src/js/AstroMap.js +1 −1 Original line number Diff line number Diff line import AstroProj from "./AstroProj"; import LayerCollection from "./LayerCollection"; import "leaflet-fullscreen"; import L from "leaflet"; /** * @class AstroMap * @aka L.Map.AstroMap Loading app/src/js/LayerCollection.js +1 −0 Original line number Diff line number Diff line import { MY_JSON_MAPS } from "./layers"; import L from "leaflet"; import $ from "jquery"; /** Loading app/src/js/MousePosition.js +1 −1 Original line number Diff line number Diff line import AstroMath from "./AstroMath"; import "leaflet"; import L from "Leaflet"; /** * @class MousePosition * @aka L.Control.AstroMousePosition Loading app/test/AstroMath_test.js→app/test/AstroMathTest.js +10 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,16 @@ let testMath = new AstroMath("mars"); describe('Testing AstroMath Functions', function() { beforeEach(function() { // setup math class let testMath = new AstroMath("mars"); }); afterEach(function() { // do nothing }) // testing AstroMath created a class object it('Testing AstroMath Object', function() { // add an assertion Loading app/test/MousePositionTest.js 0 → 100644 +29 −0 Original line number Diff line number Diff line import "jsdom-global/register"; import jsdom from "mocha-jsdom"; import AstroMap from "../src/js/AstroMap"; import MousePosition from "../src/js/MousePosition"; import { assert, expect } from "chai"; beforeEach(function() { // Setup map div document.body.innerHTML = '<div id="map"></div>'; }); afterEach(function() { // Setup map div document.body.innerHTML = ""; }); /* In order for test to run correctly you must comment out html and event code from _add function in MousePosition. */ describe("MousePosition Added to AstroMap", function() { it("testMousePosition._map returns the map object if attached with no errors", function() { let target = "Mars"; let testMap = new AstroMap("map", target, {}); let testMousePosition = new MousePosition({ numDigits: 3 }).addTo(testMap); expect(testMousePosition._map).to.be.an("Object"); }); }); No newline at end of file Loading
app/src/js/AstroMap.js +1 −1 Original line number Diff line number Diff line import AstroProj from "./AstroProj"; import LayerCollection from "./LayerCollection"; import "leaflet-fullscreen"; import L from "leaflet"; /** * @class AstroMap * @aka L.Map.AstroMap Loading
app/src/js/LayerCollection.js +1 −0 Original line number Diff line number Diff line import { MY_JSON_MAPS } from "./layers"; import L from "leaflet"; import $ from "jquery"; /** Loading
app/src/js/MousePosition.js +1 −1 Original line number Diff line number Diff line import AstroMath from "./AstroMath"; import "leaflet"; import L from "Leaflet"; /** * @class MousePosition * @aka L.Control.AstroMousePosition Loading
app/test/AstroMath_test.js→app/test/AstroMathTest.js +10 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,16 @@ let testMath = new AstroMath("mars"); describe('Testing AstroMath Functions', function() { beforeEach(function() { // setup math class let testMath = new AstroMath("mars"); }); afterEach(function() { // do nothing }) // testing AstroMath created a class object it('Testing AstroMath Object', function() { // add an assertion Loading
app/test/MousePositionTest.js 0 → 100644 +29 −0 Original line number Diff line number Diff line import "jsdom-global/register"; import jsdom from "mocha-jsdom"; import AstroMap from "../src/js/AstroMap"; import MousePosition from "../src/js/MousePosition"; import { assert, expect } from "chai"; beforeEach(function() { // Setup map div document.body.innerHTML = '<div id="map"></div>'; }); afterEach(function() { // Setup map div document.body.innerHTML = ""; }); /* In order for test to run correctly you must comment out html and event code from _add function in MousePosition. */ describe("MousePosition Added to AstroMap", function() { it("testMousePosition._map returns the map object if attached with no errors", function() { let target = "Mars"; let testMap = new AstroMap("map", target, {}); let testMousePosition = new MousePosition({ numDigits: 3 }).addTo(testMap); expect(testMousePosition._map).to.be.an("Object"); }); }); No newline at end of file