|
1 | 1 | import os from 'os' |
2 | 2 | import chokidar from 'chokidar' |
3 | | -import type { ResolvedFromConfig, RESOLVED_FROM, TestingType, SpecWithRelativeRoot } from '@packages/types' |
| 3 | +import type { ResolvedFromConfig, TestingType, SpecWithRelativeRoot } from '@packages/types' |
4 | 4 | import minimatch from 'minimatch' |
5 | 5 | import _ from 'lodash' |
6 | 6 | import path from 'path' |
@@ -558,26 +558,13 @@ export class ProjectDataSource { |
558 | 558 | async getResolvedConfigFields (): Promise<ResolvedFromConfig[]> { |
559 | 559 | const config = this.ctx.lifecycleManager.loadedFullConfig?.resolved ?? {} |
560 | 560 |
|
561 | | - interface ResolvedFromWithField extends ResolvedFromConfig { |
562 | | - field: typeof RESOLVED_FROM[number] |
563 | | - } |
564 | | - |
565 | | - const mapEnvResolvedConfigToObj = (config: ResolvedFromConfig): ResolvedFromWithField => { |
566 | | - return Object.entries(config).reduce<ResolvedFromWithField>((acc, [field, value]) => { |
| 561 | + return Object.entries(config ?? {}).map(([key, value]) => { |
| 562 | + if ((key === 'env' || key === 'expose') && value) { |
567 | 563 | return { |
568 | | - ...acc, |
569 | | - value: { ...acc.value, [field]: value.value }, |
| 564 | + field: key, |
| 565 | + from: key, |
| 566 | + value: Object.fromEntries(Object.entries(value).map(([field, { value }]) => [field, value])), |
570 | 567 | } |
571 | | - }, { |
572 | | - value: {}, |
573 | | - field: 'env', |
574 | | - from: 'env', |
575 | | - }) |
576 | | - } |
577 | | - |
578 | | - return Object.entries(config ?? {}).map(([key, value]) => { |
579 | | - if (key === 'env' && value) { |
580 | | - return mapEnvResolvedConfigToObj(value) |
581 | 568 | } |
582 | 569 |
|
583 | 570 | return { ...value, field: key } |
|
0 commit comments