Skip to content

Commit c0b2e41

Browse files
committed
Document/test city option in formatterPattern
1 parent a0171dc commit c0b2e41

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ You can specify request timeout using paramater `options.timeout`
163163
* `%z` zip code
164164
* `%T` State
165165
* `%t` state code
166+
* `%c` City
166167

167168
## More
168169

test/formatter/stringformatter.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('StringFormatter', () => {
1414
});
1515
describe('#format' , () => {
1616
test('should replace pattern with correct values', () => {
17-
var formatter = new StringFormatter('%P %p %n %S %z %T %t');
17+
var formatter = new StringFormatter('%P %p %n %S %z %T %t %c');
1818

1919
var results = formatter.format([{
2020
country: 'France',
@@ -23,14 +23,15 @@ describe('StringFormatter', () => {
2323
streetName: 'rue chevreul',
2424
zipcode: '69007',
2525
state: 'Rhone alpes',
26-
stateCode: 'RA'
26+
stateCode: 'RA',
27+
city: 'Lyon',
2728
}]);
2829

2930
results.should.have.length(1);
3031
var string = results[0];
3132

3233
string.should.be.a('string');
33-
string.should.equal('France FR 29 rue chevreul 69007 Rhone alpes RA');
34+
string.should.equal('France FR 29 rue chevreul 69007 Rhone alpes RA Lyon');
3435
});
3536
});
3637
});

0 commit comments

Comments
 (0)