Skip to content

Commit

Permalink
feat: add Transaction Date (#17)
Browse files Browse the repository at this point in the history
* transaction_date
* add to readme
* get this version of tap to work on node 20
* include TRANSACTION_DATE defaults in tests
---------

Co-authored-by: nexdrew <[email protected]>
  • Loading branch information
nnsier and nexdrew authored Jan 19, 2024
1 parent 62618f9 commit 0c2d127
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Shortcut to get the plural value defined for `key`. If a singular value is defin
- `Strings.RULE`
- `Strings.SALE`
- `Strings.TEAM`
- `Strings.TRANSACTION_DATE`
- `Strings.UNIT`
- `Strings.VOLUME`

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"prepare": "babel src -d lib",
"pretest": "standard && npm run prepare",
"test": "tap --cov test.js",
"test": "tap --reporter=classic --cov test.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"html": "nyc report --reporter=html && open coverage/index.html",
"release": "standard-version"
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ Strings.PLAN = 'plan'
Strings.QUOTA = 'quota'
Strings.RULE = 'rule'
Strings.SALE = 'sale'
Strings.TRANSACTION_DATE = 'transaction_date'
Strings.COMPENSATION = 'compensation'
Strings.REPORT = 'report'
Strings.DRAFT = 'draft'
Expand Down Expand Up @@ -345,6 +346,7 @@ Strings.DEFAULTS = {
[Strings.QUOTA]: 'Quota',
[Strings.RULE]: 'Rule',
[Strings.SALE]: 'Sale',
[Strings.TRANSACTION_DATE]: 'Transaction Date',
[Strings.COMPENSATION]: {
singular: 'Compensation',
plural: 'Compensation'
Expand Down
3 changes: 3 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ tap.test('instance get', t => {
t.strictEqual(s.get(Strings.GROSS_MARGIN, { abbrev: true }), 'Pft')
t.strictEqual(d.get(Strings.ANNUAL_CONTRACT_VALUE, { abbrev: true }), 'ACV')
t.strictEqual(s.get(Strings.ANNUAL_CONTRACT_VALUE, { abbrev: true }), 'ACV')
t.strictEqual(d.get(Strings.TRANSACTION_DATE, { abbrev: true }), 'TD')

// 2rd arg object as opts with plural boolean and flu boolean
t.strictEqual(d.get(Strings.REPORT, { plural: false, flu: true }), 'Report')
Expand Down Expand Up @@ -964,6 +965,8 @@ tap.test('defaults', t => {
t.strictEqual(d.getPlural(Strings.RULE), 'Rules')
t.strictEqual(d.getSingular(Strings.SALE), 'Sale')
t.strictEqual(d.getPlural(Strings.SALE), 'Sales')
t.strictEqual(d.getSingular(Strings.TRANSACTION_DATE), 'Transaction Date')
t.strictEqual(d.getPlural(Strings.TRANSACTION_DATE), 'Transaction Dates')
t.strictEqual(d.getSingular(Strings.COMPENSATION), 'Compensation')
t.strictEqual(d.getPlural(Strings.COMPENSATION), 'Compensation')
t.strictEqual(d.getSingular(Strings.REPORT), 'Report')
Expand Down

0 comments on commit 0c2d127

Please sign in to comment.