test/setup.js

Header Image
Project:
test/setup.js : Public <<file>> Component
Created: 2023-01-26 3:57:09 PM
Modified: 2023-02-06 12:37:48 PM
Project:
Advanced:
setup.js is used by the jest testing framework to import the leaflet.js and mapml.js scripts from their built location in dist.<br/><br/>setup.js "imports" leaflet.js and mapml.js using the require("...") function, that I believe is part of the "CommonJS" module system, which pre-dates ES modules.  CommonJS has been supported by node.js for a long time, apparently.  There are many node.js libraries (like jest) that use CommonJS, so it will likely be supported forever.  However the import-export syntax and behaviour is different between CommonJS and ES Modules, so that can be confusing.<br/><br/>Here's a SO question explaining a bit about the difference:<br/><br/>https://stackoverflow.com/a/46677972<br/><br/><br/><br/><br/><br/><br/>
  • Files
  • Advanced
File Type
test/setup.js Local File
Details:

File Size:
Time Stamp:
Property Value
isIndirectlyInstantiated: true
isFinalSpecialization: 0