-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a warning for Windows developers
The tests won't work if you don't have "Developer Mode" enabled. See #1852 Co-authored-by: Aurelien Reeves <aurelien.reeves@smartbear.com>
- Loading branch information
1 parent
26ef112
commit 526cc81
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
features/support/warn_user_about_enabling_developer_mode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { reindent } from 'reindent-template-literals' | ||
import colors from 'colors/safe' | ||
|
||
export function warnUserAboutEnablingDeveloperMode(error: any): void { | ||
if (!(error?.code === 'EPERM')) { | ||
throw error | ||
} | ||
if (!(process.platform === 'win32')) { | ||
throw error | ||
} | ||
|
||
console.error( | ||
colors.red( | ||
reindent(` | ||
Error: Unable to run feature tests! | ||
You need to enable Developer Mode in Windows to run Cucumber JS's feature tests. | ||
See this link for more info: | ||
https://docs.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging | ||
`) | ||
) | ||
) | ||
process.exit(1) | ||
} |