fix(prettier): Properly handle lint-stage files (#6970)
Now handles top level files and recursive files in folders. Set max line length to be 100
This commit is contained in:
@@ -32,18 +32,10 @@ describe_only_db('mongo')('Parse.Query hint', () => {
|
||||
const object = new TestObject();
|
||||
await object.save();
|
||||
|
||||
const collection = await config.database.adapter._adaptiveCollection(
|
||||
'TestObject'
|
||||
);
|
||||
let explain = await collection._rawFind(
|
||||
{ _id: object.id },
|
||||
{ explain: true }
|
||||
);
|
||||
const collection = await config.database.adapter._adaptiveCollection('TestObject');
|
||||
let explain = await collection._rawFind({ _id: object.id }, { explain: true });
|
||||
expect(explain.queryPlanner.winningPlan.stage).toBe('IDHACK');
|
||||
explain = await collection._rawFind(
|
||||
{ _id: object.id },
|
||||
{ hint: '_id_', explain: true }
|
||||
);
|
||||
explain = await collection._rawFind({ _id: object.id }, { hint: '_id_', explain: true });
|
||||
expect(explain.queryPlanner.winningPlan.stage).toBe('FETCH');
|
||||
expect(explain.queryPlanner.winningPlan.inputStage.indexName).toBe('_id_');
|
||||
});
|
||||
@@ -52,18 +44,10 @@ describe_only_db('mongo')('Parse.Query hint', () => {
|
||||
const object = new TestObject();
|
||||
await object.save();
|
||||
|
||||
const collection = await config.database.adapter._adaptiveCollection(
|
||||
'TestObject'
|
||||
);
|
||||
let explain = await collection._rawFind(
|
||||
{ _id: object.id },
|
||||
{ explain: true }
|
||||
);
|
||||
const collection = await config.database.adapter._adaptiveCollection('TestObject');
|
||||
let explain = await collection._rawFind({ _id: object.id }, { explain: true });
|
||||
expect(explain.queryPlanner.winningPlan.stage).toBe('IDHACK');
|
||||
explain = await collection._rawFind(
|
||||
{ _id: object.id },
|
||||
{ hint: { _id: 1 }, explain: true }
|
||||
);
|
||||
explain = await collection._rawFind({ _id: object.id }, { hint: { _id: 1 }, explain: true });
|
||||
expect(explain.queryPlanner.winningPlan.stage).toBe('FETCH');
|
||||
expect(explain.queryPlanner.winningPlan.inputStage.keyPattern).toEqual({
|
||||
_id: 1,
|
||||
@@ -74,9 +58,7 @@ describe_only_db('mongo')('Parse.Query hint', () => {
|
||||
const object = new TestObject({ foo: 'bar' });
|
||||
await object.save();
|
||||
|
||||
const collection = await config.database.adapter._adaptiveCollection(
|
||||
'TestObject'
|
||||
);
|
||||
const collection = await config.database.adapter._adaptiveCollection('TestObject');
|
||||
let result = await collection.aggregate([{ $group: { _id: '$foo' } }], {
|
||||
explain: true,
|
||||
});
|
||||
@@ -96,9 +78,7 @@ describe_only_db('mongo')('Parse.Query hint', () => {
|
||||
const object = new TestObject({ foo: 'bar' });
|
||||
await object.save();
|
||||
|
||||
const collection = await config.database.adapter._adaptiveCollection(
|
||||
'TestObject'
|
||||
);
|
||||
const collection = await config.database.adapter._adaptiveCollection('TestObject');
|
||||
let result = await collection.aggregate([{ $group: { _id: '$foo' } }], {
|
||||
explain: true,
|
||||
});
|
||||
@@ -136,9 +116,7 @@ describe_only_db('mongo')('Parse.Query hint', () => {
|
||||
});
|
||||
response = await request(options);
|
||||
explain = response.data.results;
|
||||
expect(
|
||||
explain.queryPlanner.winningPlan.inputStage.inputStage.indexName
|
||||
).toBe('_id_');
|
||||
expect(explain.queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_');
|
||||
});
|
||||
|
||||
it('query aggregate with hint (rest)', async () => {
|
||||
|
||||
Reference in New Issue
Block a user