mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-25 11:02:11 +03:00
Merge pull request #374 from Hywan/js_test_date_locale
test(js) Fix expectations regarding given locales
This commit is contained in:
commit
e912b9d2a2
@ -256,7 +256,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), 'Thursday, December 20, 2012');
|
||||
let output = wasm.to_locale_date_string(date, 'de-DE', options)
|
||||
assert.equal(typeof output, 'string');
|
||||
assert.ok(output.length > 0);
|
||||
}
|
||||
"#)
|
||||
.test()
|
||||
@ -284,7 +286,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' }), "12/20/2012, 3:00:00 AM");
|
||||
let output = wasm.to_locale_string(date, 'en-GB', { timeZone: 'UTC' });
|
||||
assert.equal(typeof output, 'string');
|
||||
assert.ok(output.length > 0);
|
||||
}
|
||||
"#)
|
||||
.test()
|
||||
|
Loading…
Reference in New Issue
Block a user