diff --git a/tests/spec/run.js b/tests/spec/run.js index 67322c2..bac3627 100644 --- a/tests/spec/run.js +++ b/tests/spec/run.js @@ -413,7 +413,13 @@ async function runOperation(op, entities) { case 'findOneAndDelete': return unwrapFam(await target.findOneAndDelete(args.filter, options(args))); // -- collection / index management ---------------------------------- - case 'createIndex': return await target.createIndex(args.keys, options(args)); + // `name` is positional for `dropIndex` and an *option* for this one, + // so it is put back after `options` strips it -- without that, a + // corpus asking for a named index silently gets a derived name. + case 'createIndex': return await target.createIndex(args.keys, { + ...options(args), + ...(args.name !== undefined ? { name: args.name } : {}), + }); case 'dropIndex': return await target.dropIndex(args.name, options(args)); case 'createCollection': return void (await target.createCollection(args.collection, options(args, ['collection']))); case 'dropCollection': return void (await target.dropCollection(args.collection, options(args, ['collection'])));