File tree Expand file tree Collapse file tree 3 files changed +33
-5
lines changed
packages/cubejs-testing/test/driverTests Expand file tree Collapse file tree 3 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export type TestType = 'basic' | 'withError' | 'testFn';
77
88type DriverTestArg = {
99 name : string ;
10- query : Query ;
10+ query : Query | Query [ ] ;
1111 expectArray ?: ( ( response : ResultSet < QueryRecordType < Query > > ) => any ) [ ] ;
1212 schemas : Schemas ;
1313 skip ?: boolean ;
@@ -23,7 +23,7 @@ type DriverTestWithErrorArg = {
2323
2424export type DriverTestBasic = {
2525 name : string ,
26- query : Query ,
26+ query : Query | Query [ ] ,
2727 expectArray ?: ( ( response : ResultSet < QueryRecordType < Query > > ) => any ) [ ]
2828 schemas : Schemas ,
2929 skip ?: boolean ;
@@ -32,7 +32,7 @@ export type DriverTestBasic = {
3232
3333export type DriverTestWithError = {
3434 name : string ;
35- query : Query ;
35+ query : Query | Query [ ] ;
3636 expectArray ?: ( ( e : Error ) => any ) [ ] ;
3737 schemas : Schemas ;
3838 skip ?: boolean ;
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ import {
6262 hiddenCube ,
6363 viewMetaExposed ,
6464 preAggsCustomersRunningTotal ,
65+ queryingECommerceCompareDateRangesByCustomerOverProductNameByMonth ,
6566} from './tests' ;
6667import { testSet } from './driverTest' ;
6768
@@ -103,7 +104,8 @@ const withOrderingTestSet = testSet([
103104 queryingECommerceCountByCitiesOrder ,
104105 queryingECommerceTotalQuantityAvgDiscountTotalSales ,
105106 queryingECommerceTotalSalesTotalProfitByMonthAndOrder ,
106- queryingEcommerceTotalQuantifyAvgDiscountTotal
107+ queryingEcommerceTotalQuantifyAvgDiscountTotal ,
108+ queryingECommerceCompareDateRangesByCustomerOverProductNameByMonth
107109] ) ;
108110
109111const withoutOrderingTestSet = testSet ( [
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ export const filteringCustomersCubeThird = driverTest(
189189 } ,
190190 schemas : commonSchemas ,
191191 }
192-
192+
193193) ;
194194
195195export const filteringCustomersEndsWithFilterFirst = driverTest ( {
@@ -1296,6 +1296,32 @@ export const preAggsCustomersRunningTotal = driverTest({
12961296 schemas : commonSchemas
12971297} ) ;
12981298
1299+ export const queryingECommerceCompareDateRangesByCustomerOverProductNameByMonth = driverTest ( {
1300+ name : 'querying ECommerce: compare DateRanges by customer over productName by month' ,
1301+ query : [ {
1302+ timeDimensions : [ {
1303+ dimension : 'ECommerce.orderDate' ,
1304+ granularity : 'month' ,
1305+ compareDateRange : [
1306+ [ '2023-01-01' , '2024-01-01' ] ,
1307+ [ '2024-01-01' , '2025-01-01' ]
1308+ ]
1309+ } ] ,
1310+ dimensions : [
1311+ 'ECommerce.productName'
1312+ ] ,
1313+ measures : [
1314+ 'ECommerce.countApproxByCustomer'
1315+ ] ,
1316+ order : {
1317+ 'ECommerce.orderDate' : 'desc' ,
1318+ 'ECommerce.countApproxByCustomer' : 'desc' ,
1319+ 'ECommerce.productName' : 'asc' ,
1320+ } ,
1321+ } ] ,
1322+ schemas : commonSchemas
1323+ } ) ;
1324+
12991325export const queryingEcommerceTotalQuantifyAvgDiscountTotal = driverTestWithError ( {
13001326 name : 'querying ECommerce: total quantity, avg discount, total ' +
13011327 'sales, total profit by product + order + total -- noisy ' +
You can’t perform that action at this time.
0 commit comments