Closed jacobg closed 11 years ago
Its in the documentation right at the front page.
Hi Long, Is the documentation you are talking about: readme.md? I don't see where it discusses how the test suite tests all the javascript libraries (Fleegix, JQuery) ? I don't see them required in the test files either. I'm not familiar with jake, but I did install it and the test cases pass, so I'm not sure where these libraries are included at. Thanks.
Right in the Setup section:
"If you use timezoneJS.Date
with Fleegix.js
, there's nothing else you need to do -- timezones for North America will be loaded and parsed on initial page load, and others will be downloaded and parsed on-the-fly, as needed. If you want to use this code with some other JavaScript toolkit, you'll need to overwrite your own transport method by setting timezoneJS.timezone.transport = someFunction
method. Take a look at test-utils.js
in spec for an example."
Sorry, still not following you. I understand the transport function, but where does Fleegix.js get downloaded and included into the test suite? When you run date.js in your application, you still need the following in your html file:
<script type="text/javascript" src="fleegix.js"></script>
What is the equivalent by the test suite?
The test suite uses NodeJS which has filesystem support:
https://github.com/mde/timezone-js/blob/master/spec/test-utils.js
Ok, I just noticed that test-utils.js overwrites the transport function with a filesystem read, so the javascript libraries are never used in the test suite. That means that the real transport function doesn't get tested in the suite. Is that acceptable?
I'd say it's not ideal but transport
is such a thin layer that does basically nothing other than invoking external AJAX libraries to retrieve resources. Using fs allows us to automate testing, definitely does not cover all browsers out there but it's a good start. Can definitely have some improvements here.
Ok. thanks
I am planning to implement this, and to submit a pull request when it's ready. I don't see specific test cases for the different javascript libraries as transport, nor do I see where any particular library is included into the test suite. Can someone explain please? Thanks.