mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-24 06:33:33 +03:00
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:
parent
54523d82ed
commit
f5d4751c0b
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user