Closed OleDakotaJoe closed 3 years ago
I'm wondering if it's a good idea to convert them back to require
. It's a pretty old syntax and import
would be much cleaner. It's probably better to make the tests work with import
Hey good point. I will do some research and see if I can get them working, but so far I have only been able to accomplish this by doing one of two things:
type=module
int the <script src=foo type= module>
tagfileName.mjs
Can you advise on another method?
I cannot find any method of implementing these tests as is and still using requirejs , without adding another dependency, or refactoring the entire project to remove requirejs, but then adding a global state dependency.
As is, the tests are completely inoperable, as requirejs is a 10 year old project, and came out long before es2015.
Do you have any suggestions on how to move forward?
requirejs
can stay, it's just the require
import syntax that should not be used.
I checked and you could just import requirejs with the import keyword, and put type=module
inside package.json. That is working for me (also check that you are using an updated node version)
Refactored PR to include newer ES6 syntax import
rather than older require()
syntax.
Thanks for the tip.
Summary
package.json
file, there was no longer any need for the infoTests.js file, so it was deleted.Other Information
The issue linked to this can PR can be found here. A snippet of the errors is shown in the original issue.