Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Commit

Permalink
Update unit tests for Node 0.11's incomplete Intl
Browse files Browse the repository at this point in the history
Node 0.11's `Intl` implementation is incomplete, so this change to the
unit tests works around the fact that it's locale resolving does not
currently work properly.
  • Loading branch information
ericf committed Jan 23, 2015
1 parent 098c08c commit b6e9875
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,16 @@ describe('IntlRelativeFormat', function () {
// grab ahold of an Intl.NumberFormat instance to check its resolved
// locale.

var expected = new Intl.NumberFormat('en-GB').resolvedOptions();

var rf = new IntlRelativeFormat('en-GB');
var internalMF = rf._compileMessage('second');

function checkInternalMessagePattern(pattern) {
var subPattern = pattern[0].options.future[0].options.other[0];
var nf = subPattern.numberFormat;
var resolved = subPattern.numberFormat.resolvedOptions();

expect(nf.resolvedOptions().locale).to.equal('en-GB');
expect(resolved.locale).to.equal(expected.locale);
}

// Override private method, which will expose the internal Message
Expand Down

0 comments on commit b6e9875

Please sign in to comment.