1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 18:18:53 +08:00

Create an empty database #44

This commit is contained in:
lana-k
2021-05-05 21:44:44 +02:00
parent 4619461af8
commit bcaebd4840
8 changed files with 130 additions and 102 deletions

View File

@@ -146,7 +146,7 @@ describe('database.js', () => {
}
const progressHandler = sinon.spy()
const progressCounterId = db.createProgressCounter(progressHandler)
const { dbName, schema } = await db.createDb('foo', data, progressCounterId)
const { dbName, schema } = await db.importDb('foo', data, progressCounterId)
expect(dbName).to.equal('foo')
expect(schema).to.have.lengthOf(1)
expect(schema[0].name).to.equal('csv_import')
@@ -164,7 +164,7 @@ describe('database.js', () => {
expect(progressHandler.secondCall.calledWith(100)).to.equal(true)
})
it('createDb throws errors', async () => {
it('importDb throws errors', async () => {
const data = {
columns: ['id', 'name'],
values: [
@@ -174,7 +174,7 @@ describe('database.js', () => {
}
const progressHandler = sinon.stub()
const progressCounterId = db.createProgressCounter(progressHandler)
await expect(db.createDb('foo', data, progressCounterId))
await expect(db.importDb('foo', data, progressCounterId))
.to.be.rejectedWith('column index out of range')
})