mirror of
https://github.com/h-sphere/sql-seal.git
synced 2026-07-22 10:10:28 +00:00
Merge pull request #38 from h-sphere/chore/adding-more-tests
chore: adding more tests and reworking jest globals
This commit is contained in:
commit
79258ebd1c
6 changed files with 28 additions and 10 deletions
|
|
@ -19,7 +19,6 @@
|
|||
"author": "",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@jest/globals": "^29.7.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/lodash": "^4.17.13",
|
||||
"@types/node": "^22.9.3",
|
||||
|
|
|
|||
|
|
@ -51,9 +51,6 @@ importers:
|
|||
specifier: ^11.0.4
|
||||
version: 11.0.4
|
||||
devDependencies:
|
||||
'@jest/globals':
|
||||
specifier: ^29.7.0
|
||||
version: 29.7.0
|
||||
'@types/jest':
|
||||
specifier: ^29.5.14
|
||||
version: 29.5.14
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { describe, it, expect } from '@jest/globals'
|
||||
import { parseLanguage } from './newParser'
|
||||
|
||||
|
||||
|
|
@ -73,6 +72,14 @@ select * from files`)).toEqual({
|
|||
"queryPart": "select * from files",
|
||||
"tables": [],
|
||||
})
|
||||
|
||||
expect(parseLanguage(`
|
||||
html
|
||||
select * from files`)).toEqual({
|
||||
"intermediateContent": "html",
|
||||
"queryPart": "select * from files",
|
||||
"tables": [],
|
||||
})
|
||||
})
|
||||
|
||||
it('should properly parse query where SELECT is in sPoNgeBoB-cAsE', () => {
|
||||
|
|
@ -105,4 +112,19 @@ sElEcT * fRoM files`)).toEqual({
|
|||
]
|
||||
})
|
||||
})
|
||||
|
||||
it('should properly parse query with just table and sql syntax', () => {
|
||||
const q = `table x = file(aaa.csv)
|
||||
select * from x`
|
||||
expect(parseLanguage(q)).toEqual({
|
||||
queryPart: 'select * from x',
|
||||
intermediateContent: '',
|
||||
tables: [
|
||||
{
|
||||
tableName: 'x',
|
||||
fileName: 'aaa.csv'
|
||||
}
|
||||
]
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
import { describe, it, expect } from '@jest/globals'
|
||||
import { transformQuery } from './sqlTransformer'
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import { describe, it, expect } from '@jest/globals'
|
||||
import { predictJson, predictType } from './typePredictions'
|
||||
|
||||
describe('Utils', () => {
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@
|
|||
"importHelpers": false,
|
||||
"isolatedModules": true,
|
||||
"skipLibCheck": true,
|
||||
"types": [],
|
||||
"strictNullChecks": true,
|
||||
"types": [
|
||||
"jest"
|
||||
],
|
||||
"strictNullChecks": true,
|
||||
"lib": [
|
||||
"DOM",
|
||||
"ES5",
|
||||
|
|
@ -24,4 +26,4 @@
|
|||
"include": [
|
||||
"**/*.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue