@@ -26,7 +26,7 @@ describe('CliRepl', () => {
26
26
const tmpdir = useTmpdir ( ) ;
27
27
28
28
async function log ( ) : Promise < any [ ] > {
29
- return readReplLogfile ( path . join ( tmpdir . path , `${ cliRepl . logId } _log` ) ) ;
29
+ return readReplLogfile ( path . join ( tmpdir . path , `${ cliRepl . logWriter . logId } _log` ) ) ;
30
30
}
31
31
32
32
async function startWithExpectedImmediateExit ( cliRepl : CliRepl , host : string ) : Promise < void > {
@@ -165,22 +165,22 @@ describe('CliRepl', () => {
165
165
} ) ;
166
166
167
167
it ( 'writes syntax errors to the log file' , async ( ) => {
168
- expect ( ( await log ( ) ) . filter ( entry => entry . stack ?. startsWith ( 'SyntaxError:' ) ) ) . to . have . lengthOf ( 0 ) ;
168
+ expect ( ( await log ( ) ) . filter ( entry => entry . attr ?. stack ?. startsWith ( 'SyntaxError:' ) ) ) . to . have . lengthOf ( 0 ) ;
169
169
input . write ( '<cat>\n' ) ;
170
170
await waitBus ( cliRepl . bus , 'mongosh:error' ) ;
171
- expect ( ( await log ( ) ) . filter ( entry => entry . stack ?. startsWith ( 'SyntaxError:' ) ) ) . to . have . lengthOf ( 1 ) ;
171
+ expect ( ( await log ( ) ) . filter ( entry => entry . attr ?. stack ?. startsWith ( 'SyntaxError:' ) ) ) . to . have . lengthOf ( 1 ) ;
172
172
} ) ;
173
173
174
174
it ( 'writes JS errors to the log file' , async ( ) => {
175
175
input . write ( 'throw new Error("plain js error")\n' ) ;
176
176
await waitBus ( cliRepl . bus , 'mongosh:error' ) ;
177
- expect ( ( await log ( ) ) . filter ( entry => entry . stack ?. startsWith ( 'Error: plain js error' ) ) ) . to . have . lengthOf ( 1 ) ;
177
+ expect ( ( await log ( ) ) . filter ( entry => entry . attr ?. stack ?. startsWith ( 'Error: plain js error' ) ) ) . to . have . lengthOf ( 1 ) ;
178
178
} ) ;
179
179
180
180
it ( 'writes Mongosh errors to the log file' , async ( ) => {
181
181
input . write ( 'db.auth()\n' ) ;
182
182
await waitBus ( cliRepl . bus , 'mongosh:error' ) ;
183
- expect ( ( await log ( ) ) . filter ( entry => entry . stack ?. startsWith ( 'MongoshInvalidInputError:' ) ) ) . to . have . lengthOf ( 1 ) ;
183
+ expect ( ( await log ( ) ) . filter ( entry => entry . attr ?. stack ?. startsWith ( 'MongoshInvalidInputError:' ) ) ) . to . have . lengthOf ( 1 ) ;
184
184
} ) ;
185
185
186
186
it ( 'emits the error event when exit() fails' , async ( ) => {
@@ -191,7 +191,7 @@ describe('CliRepl', () => {
191
191
} catch ( e ) {
192
192
const [ emitted ] = await onerror ;
193
193
expect ( emitted ) . to . be . instanceOf ( MongoshInternalError ) ;
194
- expect ( ( await log ( ) ) . filter ( entry => entry . stack ?. startsWith ( 'MongoshInternalError:' ) ) ) . to . have . lengthOf ( 1 ) ;
194
+ expect ( ( await log ( ) ) . filter ( entry => entry . attr ?. stack ?. startsWith ( 'MongoshInternalError:' ) ) ) . to . have . lengthOf ( 1 ) ;
195
195
return ;
196
196
}
197
197
expect . fail ( 'expected error' ) ;
0 commit comments