File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export class DataSource {
73
73
indentString ( `provider="${ this . provider } "\n` ) +
74
74
indentString ( `url=${ this . url } \n` ) +
75
75
( this . directUrl ? indentString ( `directUrl=${ this . directUrl } \n` ) : '' ) +
76
- ( this . shadowDatabaseUrl ? indentString ( `shadowDatabaseurl =${ this . shadowDatabaseUrl } \n` ) : '' ) +
76
+ ( this . shadowDatabaseUrl ? indentString ( `shadowDatabaseUrl =${ this . shadowDatabaseUrl } \n` ) : '' ) +
77
77
( restFields ? restFields + '\n' : '' ) +
78
78
`}`
79
79
) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,31 @@ import PrismaSchemaGenerator from '../../src/plugins/prisma/schema-generator';
9
9
import { loadModel } from '../utils' ;
10
10
11
11
describe ( 'Prisma generator test' , ( ) => {
12
+ it ( 'datasource coverage' , async ( ) => {
13
+ const model = await loadModel ( `
14
+ datasource db {
15
+ provider = 'postgresql'
16
+ url = env("DATABASE_URL")
17
+ shadowDatabaseUrl = env("DATABASE_URL")
18
+ }
19
+
20
+ model User {
21
+ id String @id
22
+ }
23
+ ` ) ;
24
+
25
+ const { name } = tmp . fileSync ( { postfix : '.prisma' } ) ;
26
+ await new PrismaSchemaGenerator ( ) . generate ( model , {
27
+ name : 'Prisma' ,
28
+ provider : '@core/prisma' ,
29
+ schemaPath : 'schema.zmodel' ,
30
+ output : name ,
31
+ } ) ;
32
+
33
+ const content = fs . readFileSync ( name , 'utf-8' ) ;
34
+ await getDMMF ( { datamodel : content } ) ;
35
+ } ) ;
36
+
12
37
it ( 'field type coverage' , async ( ) => {
13
38
const model = await loadModel ( `
14
39
datasource db {
You can’t perform that action at this time.
0 commit comments