test: move hasCrypto check · nodejs/node@edad9af (original) (raw)
`@@ -48,8 +48,11 @@ const hasCrypto = Boolean(process.versions.openssl);
`
48
48
``
49
49
`` // Check for flags. Skip this for workers (both, the cluster
module and
``
50
50
`` // worker_threads
) and child processes.
``
``
51
`+
// If the binary was built without-ssl then the crypto flags are
`
``
52
`+
// invalid (bad option). The test itself should handle this case.
`
51
53
`if (process.argv.length === 2 &&
`
52
54
`isMainThread &&
`
``
55
`+
hasCrypto &&
`
53
56
`module.parent &&
`
54
57
`require('cluster').isMaster) {
`
55
58
`// The copyright notice is relatively big and the flags could come afterwards.
`
`@@ -74,9 +77,6 @@ if (process.argv.length === 2 &&
`
74
77
`const args = process.execArgv.map((arg) => arg.replace(/_/g, '-'));
`
75
78
`for (const flag of flags) {
`
76
79
`if (!args.includes(flag) &&
`
77
``
`-
// If the binary was built without-ssl then the crypto flags are
`
78
``
`-
// invalid (bad option). The test itself should handle this case.
`
79
``
`-
hasCrypto &&
`
80
80
`` // If the binary is build without intl
the inspect option is
``
81
81
`// invalid. The test itself should handle this case.
`
82
82
`(process.features.inspector || !flag.startsWith('--inspect'))) {
`