-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(angular): fix e2e tests to support pnpm v7 (nrwl#15587)
- Loading branch information
Showing
14 changed files
with
153 additions
and
80 deletions.
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
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
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
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
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
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,41 @@ | ||
import { promisify } from 'util'; | ||
import * as treeKill from 'tree-kill'; | ||
import { logError, logInfo, logSuccess } from './log-utils'; | ||
import { check as portCheck } from 'tcp-port-used'; | ||
|
||
export const kill = require('kill-port'); | ||
const KILL_PORT_DELAY = 5000; | ||
|
||
export const promisifiedTreeKill: ( | ||
pid: number, | ||
signal: string | ||
) => Promise<void> = promisify(treeKill); | ||
|
||
export async function killPort(port: number): Promise<boolean> { | ||
if (await portCheck(port)) { | ||
try { | ||
logInfo(`Attempting to close port ${port}`); | ||
await kill(port); | ||
await new Promise<void>((resolve) => | ||
setTimeout(() => resolve(), KILL_PORT_DELAY) | ||
); | ||
if (await portCheck(port)) { | ||
logError(`Port ${port} still open`); | ||
} else { | ||
logSuccess(`Port ${port} successfully closed`); | ||
return true; | ||
} | ||
} catch { | ||
logError(`Port ${port} closing failed`); | ||
} | ||
return false; | ||
} else { | ||
return true; | ||
} | ||
} | ||
|
||
export async function killPorts(port?: number): Promise<boolean> { | ||
return port | ||
? await killPort(port) | ||
: (await killPort(3333)) && (await killPort(4200)); | ||
} |
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
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 |
---|---|---|
|
@@ -63,4 +63,4 @@ function run(): void { | |
|
||
run(); | ||
|
||
export * from './bootstrap.server'; | ||
export * from './bootstrap.server'; |
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
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
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 |
---|---|---|
|
@@ -71,4 +71,4 @@ function run(): void { | |
|
||
run(); | ||
|
||
export * from './bootstrap.server'; | ||
export * from './bootstrap.server'; |
Oops, something went wrong.