test(js) Check the types and lightly the data, but not that much.

Because NodeJS can have different i18n behaviors depending of the
version, let's keep things simple. In this case, we want to test the
types,
period. Cf. https://github.com/rustwasm/wasm-bindgen/pull/374#issuecomment-402447333
This commit is contained in:
Ivan Enderlin 2018-07-04 16:47:51 +02:00
parent 54523d82ed
commit f5d4751c0b
No known key found for this signature in database
GPG Key ID: 461F31FCE31F4AAD

View File

@ -160,7 +160,9 @@ fn to_locale_date_string() {
let date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
let options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
assert.equal(wasm.to_locale_date_string(date, 'de-DE', options), 'Donnerstag, 20. Dezember 2012');
let output = wasm.to_locale_date_string(date, 'de-DE', options)
assert.equal(typeof output, 'string');
assert.ok(output.length > 0);
}
"#)
.test()
@ -188,7 +190,9 @@ fn to_locale_string() {
export function test() {
let date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
assert.equal(wasm.to_locale_string(date, 'en-GB', { timeZone: 'UTC' }), "20/12/2012, 03:00:00");
let output = wasm.to_locale_string(date, 'en-GB', { timeZone: 'UTC' });
assert.equal(typeof output, 'string');
assert.ok(output.length > 0);
}
"#)
.test()