···409409function cloneByOwnProperties(value: any) {
410410 // Clones the value's properties into a new Object. The simpler approach of
411411 // Object.assign() won't work in the case that properties are not enumerable.
412412- return Object.getOwnPropertyNames(value).reduce(
413413- (clone, prop) => ({
414414- ...clone,
415415- [prop]: value[prop],
416416- }),
417417- {},
418418- )
412412+ const clone: Record<string, unknown> = {}
413413+ for (const prop of Object.getOwnPropertyNames(value)) {
414414+ clone[prop] = value[prop]
415415+ }
416416+ return clone
419417}
420418421419/**
+7-3
packages/runner/src/utils/collect.ts
···1818 allowOnly?: boolean,
1919): void {
2020 const matchedLocations: number[] = []
2121+ const testLocationsSet = testLocations !== undefined && testLocations.length !== 0
2222+ ? new Set(testLocations)
2323+ : undefined
2424+ const testIdsSet = testIds ? new Set(testIds) : undefined
21252226 const traverseSuite = (suite: Suite, parentIsOnly?: boolean, parentMatchedWithLocation?: boolean) => {
2327 const suiteIsOnly = parentIsOnly || suite.mode === 'only'
···5458 // Match test location against provided locations, only run if present
5559 // in `testLocations`. Note: if `includeTaskLocation` is not enabled,
5660 // all test will be skipped.
5757- if (testLocations !== undefined && testLocations.length !== 0) {
5858- if (t.location && testLocations?.includes(t.location.line)) {
6161+ if (testLocationsSet !== undefined) {
6262+ if (t.location && testLocationsSet.has(t.location.line)) {
5963 t.mode = 'run'
6064 matchedLocations.push(t.location.line)
6165 hasLocationMatch = true
···7276 if (namePattern && !getTaskFullName(t).match(namePattern)) {
7377 t.mode = 'skip'
7478 }
7575- if (testIds && !testIds.includes(t.id)) {
7979+ if (testIdsSet && !testIdsSet.has(t.id)) {
7680 t.mode = 'skip'
7781 }
7882 if (testTagsFilter && !testTagsFilter(t.tags || [])) {
+11-1
packages/vitest/src/node/ast-collect.ts
···4949const debug = createDebugger('vitest:ast-collect-info')
5050const verbose = createDebugger('vitest:ast-collect-verbose')
51515252+const INTERMEDIATE_CALL_PROPERTIES = new Set([
5353+ 'each',
5454+ 'for',
5555+ 'skipIf',
5656+ 'runIf',
5757+ 'extend',
5858+ 'scoped',
5959+ 'override',
6060+])
6161+5262function isTestFunctionName(name: string) {
5363 return name === 'it' || name === 'test' || name.startsWith('test') || name.endsWith('Test')
5464}
···153163 const properties = getProperties(callee)
154164 const property = callee?.property?.name
155165 // intermediate calls like .each(), .for() will be picked up in the next iteration
156156- if (property && ['each', 'for', 'skipIf', 'runIf', 'extend', 'scoped', 'override'].includes(property)) {
166166+ if (property && INTERMEDIATE_CALL_PROPERTIES.has(property)) {
157167 return
158168 }
159169 // skip properties on return values of calls - e.g., test('name', fn).skip()
+1-1
packages/vitest/src/node/pools/pool.ts
···346346 }
347347348348 for (const key of keys1) {
349349- if (!keys2.includes(key) || !deepEqual(obj1[key], obj2[key])) {
349349+ if (!Object.prototype.hasOwnProperty.call(obj2, key) || !deepEqual(obj1[key], obj2[key])) {
350350 return false
351351 }
352352 }