Skip to content

Commit

Permalink
speed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Mar 4, 2020
1 parent dd505d3 commit 72d0ac4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/prisma2/src/__tests__/integrate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import rimraf from 'rimraf'
import fs from 'fs'
import path from 'path'
import snapshot from 'snap-shot-it'
import { performance } from 'perf_hooks'
import { getLatestAlphaTag } from '@prisma/fetch-engine'

const connectionString = process.env.TEST_POSTGRES_URI || 'postgres://localhost:5432/prisma-dev'
process.env.SKIP_GENERATE = 'true'
Expand All @@ -19,6 +21,7 @@ const db = new Client({
const pkg = pkgup.sync() || __dirname
const tmp = join(dirname(pkg), 'tmp')
const engine = new IntrospectionEngine()
const latestAlphaPromise = getLatestAlphaTag()

before(done => {
db.connect(err => done(err))
Expand Down Expand Up @@ -125,6 +128,7 @@ async function generate(test: Test, datamodel: string) {
schemaPath,
printDownloadProgress: false,
baseDir: tmp,
version: await latestAlphaPromise,
})

await generator.generate()
Expand Down

0 comments on commit 72d0ac4

Please sign in to comment.