-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move unit tests to correct place for mssql and postgres
- Loading branch information
Showing
4 changed files
with
96 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const { getDataType } = require('../../../../src/warehouse/index'); | ||
const { getDataTypeOverride } = require('./transform'); | ||
|
||
var testCases = [ | ||
{ | ||
name: 'normalInt', | ||
data: 1, | ||
type: 'int', | ||
}, | ||
{ | ||
name: 'normalFloat', | ||
data: 2.01, | ||
type: 'float', | ||
}, | ||
{ | ||
name: 'normalBoolean', | ||
data: true, | ||
type: 'boolean', | ||
}, | ||
{ | ||
name: 'normalString', | ||
data: 'mssql transformation[*007}', | ||
type: 'string', | ||
}, | ||
{ | ||
name: 'violationErrors', | ||
data: [ | ||
{ | ||
message: | ||
'no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1', | ||
meta: {}, | ||
type: 'Unplanned-Event', | ||
}, | ||
], | ||
type: 'string', | ||
}, | ||
]; | ||
|
||
describe('MSSQL data types testing', () => { | ||
let options = {}; | ||
options.getDataTypeOverride = getDataTypeOverride; | ||
testCases.forEach((testCase) => { | ||
it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { | ||
var dataType = getDataType(testCase.name, testCase.data, options); | ||
expect(dataType).toEqual(testCase.type); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const { getDataType } = require('../../../../src/warehouse/index'); | ||
const { getDataTypeOverride } = require('./transform'); | ||
|
||
var testCases = [ | ||
{ | ||
name: 'normalInt', | ||
data: 1, | ||
type: 'int', | ||
}, | ||
{ | ||
name: 'normalFloat', | ||
data: 2.01, | ||
type: 'float', | ||
}, | ||
{ | ||
name: 'normalBoolean', | ||
data: true, | ||
type: 'boolean', | ||
}, | ||
{ | ||
name: 'normalString', | ||
data: 'postgres transformation[*007}', | ||
type: 'string', | ||
}, | ||
{ | ||
name: 'violationErrors', | ||
data: [ | ||
{ | ||
message: | ||
'no schema for eventName : Product Purchased new, eventType : track in trackingPlanID : tp_20dfXJDpotQWHe7hMxfQfgWMZDv::1', | ||
meta: {}, | ||
type: 'Unplanned-Event', | ||
}, | ||
], | ||
type: 'json', | ||
}, | ||
]; | ||
|
||
describe('Postgres data types testing', () => { | ||
let options = {}; | ||
options.getDataTypeOverride = getDataTypeOverride; | ||
testCases.forEach((testCase) => { | ||
it(`should return data type ${testCase.type} for this input data ${testCase.data} everytime`, () => { | ||
var dataType = getDataType(testCase.name, testCase.data, options); | ||
expect(dataType).toEqual(testCase.type); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.