@emartech/data-aggregator-language
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -29,3 +29,3 @@ { | ||
}, | ||
"version": "1.2.0" | ||
"version": "1.3.0" | ||
} |
@@ -63,3 +63,3 @@ 'use strict'; | ||
name: 'stringLiteral', | ||
pattern: /[\w\.]+/ | ||
pattern: /[\w\.\[\]]+/ | ||
}); | ||
@@ -66,0 +66,0 @@ |
'use strict'; | ||
const { expect } = require('chai'); | ||
const subject = require('../src/aggregator'); | ||
describe('The Aggregator Grammar', () => { | ||
const input = [ | ||
{ date: '2017-08-15', campaigns: { email: { open: 3 } } }, | ||
{ date: '2017-08-16', campaigns: { email: { open: 4 } } } | ||
{ date: '2017-08-15', campaigns: { email: { open: 3 }, values: [4, 10, 2] } }, | ||
{ date: '2017-08-16', campaigns: { email: { open: 4 }, values: [2, 9] } } | ||
]; | ||
const aggregate = require('../src/aggregator')(input); | ||
const aggregate = subject(input); | ||
@@ -116,3 +117,9 @@ describe('Binary Operands', () => { | ||
describe('string literal', () => { | ||
it('can contain []\'s', () => { | ||
expect(aggregate('LAST campaigns.values[1]')).to.eql(9); | ||
}); | ||
}); | ||
describe('when there is a parsing error', () => { | ||
@@ -119,0 +126,0 @@ it('throws an exception', () => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16235
397