55 runCommonDaoTest ,
66 runCommonDBTest ,
77 TEST_TABLE ,
8+ testItemBMJsonSchema ,
89 TestItemDBM ,
9- testItemDBMJsonSchema ,
1010} from '@naturalcycles/db-lib/dist/testing'
1111import { deflateString , inflateToString , requireEnvKeys } from '@naturalcycles/nodejs-lib'
1212import { MysqlDB } from '../mysql.db'
@@ -35,7 +35,7 @@ const db = new MysqlDB({
3535} )
3636
3737beforeAll ( async ( ) => {
38- await db . createTable ( TEST_TABLE , testItemDBMJsonSchema , { dropIfExists : true } )
38+ await db . createTable ( TEST_TABLE , testItemBMJsonSchema , { dropIfExists : true } )
3939} )
4040
4141afterAll ( async ( ) => {
@@ -50,7 +50,7 @@ test('getTableSchema', async () => {
5050 // console.log(await db.getTables())
5151 const schema = await db . getTableSchema ( TEST_TABLE )
5252 console . log ( schema )
53- expect ( testItemDBMJsonSchema ) . toMatchObject ( schema )
53+ expect ( testItemBMJsonSchema ) . toMatchObject ( schema )
5454} )
5555
5656test ( 'saveBatch overwrite' , async ( ) => {
@@ -82,7 +82,7 @@ test('fieldName with dot', async () => {
8282 const table = TEST_TABLE + '2'
8383
8484 const items = createTestItemsDBM ( 5 ) . map ( r => ( { ...r , [ fieldName ] : 'vv' } ) )
85- const schema = testItemDBMJsonSchema
85+ const schema = testItemBMJsonSchema
8686 schema . properties [ fieldName as keyof TestItemDBM ] = { type : 'string' }
8787
8888 await db . createTable ( table , schema , { dropIfExists : true } )
@@ -99,7 +99,7 @@ test('buffer', async () => {
9999
100100 const items = createTestItemsDBM ( 5 ) . map ( r => ( { ...r , extra } ) )
101101
102- const schema = testItemDBMJsonSchema
102+ const schema = testItemBMJsonSchema
103103 schema . properties [ 'extra' as keyof TestItemDBM ] = { instanceof : 'Buffer' }
104104
105105 await db . createTable ( table , schema , { dropIfExists : true } )
@@ -114,7 +114,7 @@ test('stringify objects', async () => {
114114 const item = createTestItemsDBM ( 1 ) [ 0 ] !
115115 item . k1 = { some : 'obj' , c : 'd' , e : 5 } as any
116116
117- await db . createTable ( TEST_TABLE , testItemDBMJsonSchema , { dropIfExists : true } )
117+ await db . createTable ( TEST_TABLE , testItemBMJsonSchema , { dropIfExists : true } )
118118 await db . saveBatch ( TEST_TABLE , [ item ] )
119119 const { rows } = await db . runQuery ( new DBQuery ( TEST_TABLE ) )
120120 // console.log(rows)
0 commit comments