upgrade typeorm to 3.0 (#359)

* upgrade typeorm to 3.0

* use new datasource object in typeorm 3

* fix tests

* fix tests

* migrate before creating connection

* fail the test if migration failed
This commit is contained in:
Hongbo Wu
2022-04-06 10:32:41 +08:00
committed by GitHub
parent 01001bc4a0
commit 7569e988bf
42 changed files with 357 additions and 394 deletions

View File

@ -1,7 +1,6 @@
import 'mocha'
import { expect } from 'chai'
import 'chai/register-should'
import { labelsLoader } from '../../src/services/labels'
import {
createTestLabel,
createTestLink,
@ -9,10 +8,11 @@ import {
createTestUser,
deleteTestUser,
} from '../db'
import { getRepository } from 'typeorm'
import { LinkLabel } from '../../src/entity/link_label'
import { Label } from '../../src/entity/label'
import { Link } from '../../src/entity/link'
import { labelsLoader } from '../../src/services/labels'
import { getRepository } from '../../src/entity/utils'
describe('batch get labels from linkIds', () => {
let username = 'testUser'