ibm-js / ecma402

ECMA-402 JavaScript Internationalization API "shim"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement of tests/intl_sample.html

clmath opened this issue · comments

Currently the script tags are direct children of the html tag instead of being under body or head.

Also, I think the variables could have names more significant than the current x, x1, y or y1.

And to be consistent with the other projects of ibm-js the samples should be in a /samples directory.

Oh, my fault about the <script> tags. I should have put them as the last child of <body> rather than the last child of <html>. Note that usually I put them in <head> but was trying to avoid a dependency on dojo/domReady!... although in this case I wouldn't have needed the dependency anyway.

I think the fix does not address all my concerns (about the variables name and the position of the file).
Should the issue be reopened or should I open a new one?

As a side note, I modified the test file to load ecma402/Intl instead of ecma402/IntlShim. The reason is that the test file's boilerplate text claims it's showing "IBM" vs. "native". So, it should show the IBM results even on browsers that have built-in Intl.

Yes, I saw that. And that's exactly what we want.

Regards,

John C. Emmons
Globalization Architect & Unicode CLDR TC Chairman
IBM Software Group
Internet: emmo@us.ibm.com

From: Bill Keese notifications@github.com
To: ibm-js/ecma402 ecma402@noreply.github.com,
Date: 04/17/2014 05:37 AM
Subject: Re: [ecma402] Enhancement of tests/intl_sample.html (#14)

As a side note, I modified the test file to load ecma402/Intl instead of
ecma402/IntlShim. The reason is that the test file's boilerplate text
claims it's showing "IBM" vs. "native". So, it should show the IBM results
even on browsers that have built-in Intl.


Reply to this email directly or view it on GitHub.

Not sure if this is the right place to ask, but are there any instructions on how to run the test scripts locally on my machine with local version of code?

Put a simple http server in place, turn on the javascript console, and then
point your browser to intern's client.html with a config of
"ecma402/tests/intern"

Assuming you have intern installed at "node_modules/intern" and your
http-server using port 8000, then the URL would look like:

http://localhost:8000/node_modules/intern/client.html?config=ecma402/tests/intern

Regards,

John C. Emmons
Globalization Architect & Unicode CLDR TC Chairman
IBM Software Group
Internet: emmo@us.ibm.com

From: kholy notifications@github.com
To: ibm-js/ecma402 ecma402@noreply.github.com,
Cc: John Emmons/Austin/IBM@IBMUS
Date: 05/06/2014 03:07 AM
Subject: Re: [ecma402] Enhancement of tests/intl_sample.html (#14)

Not sure if this is the right place to ask, but are there any instructions
on how to run the test scripts locally on my machine with local version of
code?


Reply to this email directly or view it on GitHub.

Finally worked , I still needed to download and extract text-master.zip from the url https://codeload.github.com/requirejs/text/zip/master and then rename the extracted folder to become requirejs-text
Now I have only 1 test case failing , I hope it is not environment related
main console.js:16
unitTest console.js:16
PASS: matcherFunctions (11ms) console.js:36
PASS: currencyFormat (7ms) console.js:36
PASS: dateTimeFormat (53ms) console.js:36
FAIL: testShim (66ms) console.js:40
AssertionError: Intl.DateTimeFormat.format() with native = true should return expected string for locale en-US: expected 'Thu, Mar 4, 1965 5:59:30 PM' to equal 'Thu, Mar 4, 1965, 5:59:30 PM'
at Function.assert.strictEqual (http://localhost/node_modules/intern/node_modules/chai/chai.js:2487:32)
at http://localhost/ecma402/tests/unitTest.js:382:12
at Array.forEach (native)
at Test.registerSuite.testShim as test
at Test.run (http://localhost/node_modules/intern/lib/Test.js:154:19)
at http://localhost/node_modules/intern/lib/Suite.js:211:13
at signalListener (http://localhost/node_modules/intern/node_modules/dojo/Deferred.js:37:21)
at Promise.then.promise.then (http://localhost/node_modules/intern/node_modules/dojo/Deferred.js:258:5)
at http://localhost/node_modules/intern/lib/Suite.js:210:46 util.js:154
3/4 tests passed

You're probably OK then. The expected result for that testcase was based
on the result returned by Firefox nightly. If you're running on a
different browser, your result may vary slightly. Here, the only
difference is the lack of a comma between the date and time. This is just
one of those examples of slight differences in behavior in the Intl APIs
between the various browsers.

Regards,

John C. Emmons
Globalization Architect & Unicode CLDR TC Chairman
IBM Software Group
Internet: emmo@us.ibm.com

From: kholy notifications@github.com
To: ibm-js/ecma402 ecma402@noreply.github.com,
Cc: John Emmons/Austin/IBM@IBMUS
Date: 05/08/2014 02:38 AM
Subject: Re: [ecma402] Enhancement of tests/intl_sample.html (#14)

Finally worked , I still needed to download and extract text-master.zip
from the url https://codeload.github.com/requirejs/text/zip/master and then
rename the extracted folder to become requirejs-text
Now I have only 1 test case failing , I hope it is not environment related
main console.js:16
unitTest console.js:16
PASS: matcherFunctions (11ms) console.js:36
PASS: currencyFormat (7ms) console.js:36
PASS: dateTimeFormat (53ms) console.js:36
FAIL: testShim (66ms) console.js:40
AssertionError: Intl.DateTimeFormat.format() with native = true should
return expected string for locale en-US: expected 'Thu, Mar 4, 1965 5:59:30
PM' to equal 'Thu, Mar 4, 1965, 5:59:30 PM'
at Function.assert.strictEqual (
http://localhost/node_modules/intern/node_modules/chai/chai.js:2487:32)
at http://localhost/ecma402/tests/unitTest.js:382:12
at Array.forEach (native)
at Test.registerSuite.testShim as test
at Test.run (http://localhost/node_modules/intern/lib/Test.js:154:19)
at http://localhost/node_modules/intern/lib/Suite.js:211:13
at signalListener (
http://localhost/node_modules/intern/node_modules/dojo/Deferred.js:37:21)
at Promise.then.promise.then (
http://localhost/node_modules/intern/node_modules/dojo/Deferred.js:258:5)
at http://localhost/node_modules/intern/lib/Suite.js:210:46 util.js:154
3/4 tests passed


Reply to this email directly or view it on GitHub.