Skip to content

Commit

Permalink
Test cases for whitespace parsing added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dalius Dobravolskas committed Feb 26, 2019
1 parent f14d786 commit b778af2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions test/fixtures/default-values.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
i18next.t('product.milk', { defaultValue: 'Milk' }); // output: 'Milk'
i18next.t('product.bread', 'Bread'); // output: 'Bread'
i18next.t('product.boiledEgg', 'Boiled Egg'); // output: 'Boiled Egg'
i18next.t(
'product.cheese',
'Cheese'
); // output: 'Cheese'
i18next.t('product.potato', '{{color}} potato', { color: 'white' }); // output: '{{color}} potato'
i18next.t(
'product.carrot',
'{{size}} carrot',
{ size: 'big' }
); // output: '{{size}} potato'
4 changes: 3 additions & 1 deletion test/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,9 @@ test('Default values test', (t) => {
'bread': 'Bread',
'milk': 'Milk',
'boiledEgg': 'Boiled Egg',
'potato': '{{color}} potato'
'cheese': 'Cheese',
'potato': '{{color}} potato',
'carrot': '{{size}} carrot',
}
}
}
Expand Down

0 comments on commit b778af2

Please sign in to comment.