File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
3
exports [` compiles an included file, and won't get stuck in an infinite include loop 1` ] = `
4
- "Circular include detected - '~/migrations/fixtures/foo.sql' is included again! Trace :
4
+ "Circular include detected - '~/migrations/fixtures/foo.sql' is included again! Import statement: \` --!include foo.sql \` ; trace :
5
5
~/migrations/fixtures/foo.sql
6
6
~/migrations/current.sql"
7
7
` ;
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ export async function compileIncludes(
154
154
// Go through these matches and resolve their full paths, checking they are allowed
155
155
const sqlPathByRawSqlPath = Object . create ( null ) as Record < string , string > ;
156
156
for ( const match of matches ) {
157
- const [ , rawSqlPath ] = match ;
157
+ const [ line , rawSqlPath ] = match ;
158
158
const sqlPath = await realpathOrNull ( `${ fixturesPath } /${ rawSqlPath } ` ) ;
159
159
160
160
if ( ! sqlPath ) {
@@ -165,7 +165,7 @@ export async function compileIncludes(
165
165
166
166
if ( processedFiles . has ( sqlPath ) ) {
167
167
throw new Error (
168
- `Circular include detected - '${ sqlPath } ' is included again! Trace :\n ${ [ ...processedFiles ] . reverse ( ) . join ( "\n " ) } ` ,
168
+ `Circular include detected - '${ sqlPath } ' is included again! Import statement: \` ${ line } \`; trace :\n ${ [ ...processedFiles ] . reverse ( ) . join ( "\n " ) } ` ,
169
169
) ;
170
170
}
171
171
You can’t perform that action at this time.
0 commit comments