Skip to content

Commit e93aa7b

Browse files
author
Evan Jacobs
committed
chore: ensure consistency by adding prettier config for IDE to pick up
1 parent aedfc04 commit e93aa7b

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": false
3+
}

packages/cypress-cloud/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/// <reference types="cypress" />
2-
import 'source-map-support/register.js';
2+
import "source-map-support/register.js";
33

4-
import { run as internalRun } from './lib/run';
5-
export type { CurrentsConfig } from './lib/config/config';
6-
import { CurrentsRunAPI } from './types';
7-
export type { CurrentsRunAPI } from './types';
4+
import { run as internalRun } from "./lib/run";
5+
export type { CurrentsConfig } from "./lib/config/config";
6+
import { CurrentsRunAPI } from "./types";
7+
export type { CurrentsRunAPI } from "./types";
88
/**
99
* Run Cypress tests with a cloud service of your choice and return the results
1010
*

packages/cypress-cloud/lib/config/config.ts

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import Debug from 'debug';
1+
import Debug from "debug";
22

3-
import { P, match } from 'ts-pattern';
4-
import { DetectedBrowser, ValidatedCurrentsParameters } from '../../types';
5-
import { bootCypress } from '../bootstrap';
6-
import { info, warn } from '../log';
7-
import { getConfigFilePath } from './path';
3+
import { P, match } from "ts-pattern";
4+
import { DetectedBrowser, ValidatedCurrentsParameters } from "../../types";
5+
import { bootCypress } from "../bootstrap";
6+
import { info, warn } from "../log";
7+
import { getConfigFilePath } from "./path";
88

9-
const debug = Debug('currents:config');
9+
const debug = Debug("currents:config");
1010

1111
export type E2EConfig = {
1212
batchSize: number;
@@ -45,13 +45,13 @@ const defaultConfig: CurrentsConfig = {
4545
component: {
4646
batchSize: 5,
4747
},
48-
cloudServiceUrl: 'https://cy.currents.dev',
48+
cloudServiceUrl: "https://cy.currents.dev",
4949
networkHeaders: undefined,
5050
};
5151

5252
export async function getCurrentsConfig(
5353
projectRoot?: string,
54-
explicitConfigFilePath?: string
54+
explicitConfigFilePath?: string,
5555
): Promise<CurrentsConfig> {
5656
if (_config) {
5757
return _config;
@@ -76,7 +76,10 @@ export async function getCurrentsConfig(
7676
}
7777
}
7878

79-
warn('Failed to load config file, falling back to the default config. Attempted locations: %s', configFilePath);
79+
warn(
80+
"Failed to load config file, falling back to the default config. Attempted locations: %s",
81+
configFilePath,
82+
);
8083
_config = defaultConfig;
8184
return _config;
8285
}
@@ -86,14 +89,14 @@ async function loadConfigFile(filepath: string) {
8689
debug("loading currents config file from '%s'", filepath);
8790
return await import(filepath);
8891
} catch (e) {
89-
debug('failed loading config file from: %s', e);
92+
debug("failed loading config file from: %s", e);
9093
return null;
9194
}
9295
}
9396

9497
export type MergedConfig = Awaited<ReturnType<typeof getMergedConfig>>;
9598
export async function getMergedConfig(params: ValidatedCurrentsParameters) {
96-
debug('resolving cypress config');
99+
debug("resolving cypress config");
97100
const cypressResolvedConfig:
98101
| (Cypress.ResolvedConfigOptions & {
99102
projectRoot: string;
@@ -102,12 +105,12 @@ export async function getMergedConfig(params: ValidatedCurrentsParameters) {
102105
})
103106
| undefined = await bootCypress(params);
104107

105-
debug('cypress resolvedConfig: %O', cypressResolvedConfig);
108+
debug("cypress resolvedConfig: %O", cypressResolvedConfig);
106109

107110
// @ts-ignore
108111
const rawE2EPattern = cypressResolvedConfig.rawJson?.e2e?.specPattern;
109112
let additionalIgnorePattern: string[] = [];
110-
if (params.testingType === 'component' && rawE2EPattern) {
113+
if (params.testingType === "component" && rawE2EPattern) {
111114
// @ts-ignore
112115
additionalIgnorePattern = rawE2EPattern;
113116
}
@@ -117,14 +120,14 @@ export async function getMergedConfig(params: ValidatedCurrentsParameters) {
117120
const result = {
118121
projectRoot: cypressResolvedConfig?.projectRoot || process.cwd(),
119122
projectId: params.projectId,
120-
specPattern: cypressResolvedConfig?.specPattern || '**/*.*',
123+
specPattern: cypressResolvedConfig?.specPattern || "**/*.*",
121124
excludeSpecPattern:
122125
// @ts-ignore
123126
cypressResolvedConfig?.resolved.excludeSpecPattern.value ?? [],
124127
additionalIgnorePattern,
125128
resolved: cypressResolvedConfig,
126129
experimentalCoverageRecording: params.experimentalCoverageRecording,
127130
};
128-
debug('merged config: %O', result);
131+
debug("merged config: %O", result);
129132
return result;
130133
}

0 commit comments

Comments
 (0)