38 lines
767 B
JavaScript
Raw Normal View History

2019-06-03 21:00:03 +02:00
const knex = require('knex');
const createTable = require('../create-table');
let con;
describe('Create Table', () => {
beforeAll(() => {
con = knex({
client: 'sqlite',
connection: {
filename: './test.sqlite',
},
useNullAsDefault: true,
});
});
test('That works', () => {
return createTable(
{
collectionName: 'something',
attributes: {
id: {
type: 'specificType',
specificType: 'serial primary key',
},
title: {
type: 'string',
required: true, // not nullable
unique: true, // or [args]
default: 'hello',
},
},
},
{ knex: con, client: 'pg' }
);
});
});