File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -260,12 +260,6 @@ export function decorateWithExplain(
260
260
maxTimeMS ?: number ;
261
261
} {
262
262
type ExplainCommand = ReturnType < typeof decorateWithExplain > ;
263
- const isExplainCommand = ( doc : Document ) : doc is ExplainCommand => 'explain' in command ;
264
-
265
- if ( isExplainCommand ( command ) ) {
266
- return command ;
267
- }
268
-
269
263
const { verbosity, maxTimeMS } = explain ;
270
264
const baseCommand : ExplainCommand = { explain : command , verbosity } ;
271
265
Original file line number Diff line number Diff line change @@ -1007,11 +1007,11 @@ describe('driver utils', function () {
1007
1007
} ) ;
1008
1008
1009
1009
describe ( 'decorateWithExplain()' , function ( ) {
1010
- it ( 'when the command is a valid explain command, the command is returned unmodified ' , function ( ) {
1011
- const command = Object . freeze ( { explain : { hello : 'world' } } ) ;
1010
+ it ( 'when the command is a valid explain command, the command is still wrapped ' , function ( ) {
1011
+ const command = { explain : { hello : 'world' } } ;
1012
1012
const result = decorateWithExplain ( command , Explain . fromOptions ( { explain : true } ) ) ;
1013
1013
1014
- expect ( result ) . to . deep . equal ( command ) ;
1014
+ expect ( result ) . to . deep . equal ( { explain : command , verbosity : 'allPlansExecution' } ) ;
1015
1015
} ) ;
1016
1016
1017
1017
it ( 'when the options have a maxTimeMS, it is attached to the explain command' , function ( ) {
You can’t perform that action at this time.
0 commit comments