codeceptjs 3.3.5-beta.5 → 3.3.5-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/command/init.js +3 -3
- package/package.json +1 -1
package/lib/command/init.js
CHANGED
|
@@ -31,7 +31,7 @@ let isTypeScript = false;
|
|
|
31
31
|
let extension = 'js';
|
|
32
32
|
|
|
33
33
|
const requireCodeceptConfigure = "const { setHeadlessWhen, setCommonPlugins } = require('@codeceptjs/configure');";
|
|
34
|
-
const importCodeceptConfigure = "import { setHeadlessWhen, setCommonPlugins } from '@codeceptjs/configure';"
|
|
34
|
+
const importCodeceptConfigure = "import { setHeadlessWhen, setCommonPlugins } from '@codeceptjs/configure';";
|
|
35
35
|
|
|
36
36
|
const configHeader = `
|
|
37
37
|
// turn on headless mode when running with HEADLESS=true environment variable
|
|
@@ -181,14 +181,14 @@ module.exports = function (initPath) {
|
|
|
181
181
|
if (isTypeScript) {
|
|
182
182
|
configSource = beautify(`export const config : CodeceptJS.MainConfig = ${inspect(config, false, 4, false)}`);
|
|
183
183
|
|
|
184
|
-
if (hasConfigure) configSource =
|
|
184
|
+
if (hasConfigure) configSource = importCodeceptConfigure + configHeader + configSource;
|
|
185
185
|
|
|
186
186
|
fs.writeFileSync(typeScriptconfigFile, configSource, 'utf-8');
|
|
187
187
|
print(`Config created at ${typeScriptconfigFile}`);
|
|
188
188
|
} else {
|
|
189
189
|
configSource = beautify(`/** @type {CodeceptJS.MainConfig} */\nexports.config = ${inspect(config, false, 4, false)}`);
|
|
190
190
|
|
|
191
|
-
if (hasConfigure) configSource =
|
|
191
|
+
if (hasConfigure) configSource = requireCodeceptConfigure + configHeader + configSource;
|
|
192
192
|
|
|
193
193
|
fs.writeFileSync(configFile, configSource, 'utf-8');
|
|
194
194
|
print(`Config created at ${configFile}`);
|