Skip to content

Commit cf374be

Browse files
committed
Use absolut paths for loading js configs
1 parent 71eba74 commit cf374be

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

dist/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class CypressConfigParser extends cypressBaseConfigParser_1.default {
190190
if (configFilePath === null) {
191191
throw new Error("no supported config file found.");
192192
}
193-
const rawConfig = require(configFilePath);
193+
const rawConfig = require(path_1.default.resolve(configFilePath));
194194
(0, core_1.info)(`Cypress config found at "${configFilePath}: ${JSON.stringify(rawConfig, null, 2)}`);
195195
// Account for the default key in the transpiled Typescript config
196196
let config;
@@ -281,7 +281,6 @@ class CypressJSConfigParser extends CypressConfigParser {
281281
const configFilePath = CypressJSConfigParser.getConfigFile(this.workingDirectory);
282282
let config;
283283
if (configFilePath) {
284-
(0, core_1.debug)(`JS config file found at "${configFilePath}"`);
285284
config = this.processConfig(configFilePath);
286285
}
287286
else {

src/cypressConfigParser.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ abstract class CypressConfigParser extends CypressBaseConfigParser {
5656
if (configFilePath === null) {
5757
throw new Error("no supported config file found.")
5858
}
59-
const rawConfig = require(configFilePath);
59+
const rawConfig = require(path.resolve(configFilePath));
6060

6161
info(`Cypress config found at "${configFilePath}: ${JSON.stringify(rawConfig, null, 2)}`);
6262

@@ -154,8 +154,6 @@ class CypressJSConfigParser extends CypressConfigParser {
154154
const configFilePath = CypressJSConfigParser.getConfigFile(this.workingDirectory);
155155
let config;
156156
if (configFilePath) {
157-
debug(`JS config file found at "${configFilePath}"`);
158-
159157
config = this.processConfig(configFilePath)
160158
} else {
161159
throw new Error("no supported config file found.")

0 commit comments

Comments
 (0)