add tests for sqlite migration

Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/5

Reviewed By: alexsn

Differential Revision: D15875669

fbshipit-source-id: 5ddebe396b9683f364e91f2f9e6296e3659ff618
This commit is contained in:
Ariel Mashraki
2019-06-18 10:52:17 -07:00
committed by Facebook Github Bot
parent 5f0268e02c
commit 970a410b31
4 changed files with 176 additions and 17 deletions

View File

@@ -21,6 +21,13 @@ func TestMySQL_Create(t *testing.T) {
before func(sqlmock.Sqlmock)
wantErr bool
}{
{
name: "tx failed",
before: func(mock sqlmock.Sqlmock) {
mock.ExpectBegin().WillReturnError(sqlmock.ErrCancelled)
},
wantErr: true,
},
{
name: "no tables",
before: func(mock sqlmock.Sqlmock) {