-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbyte.ts
More file actions
66 lines (59 loc) · 2.12 KB
/
byte.ts
File metadata and controls
66 lines (59 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { spawnSync } from 'child_process'
import { black } from 'console-log-colors'
import * as dotenv from 'dotenv'
export class Byte {
public async getArgs(): Promise<void> {
let argv = process.argv.slice(2)
argv.forEach((arg) => {
let arr = arg.split('=')
dotenv.populate(process.env, {
[arr[0].replace('--', '').toUpperCase()]: arr[1],
})
})
}
public async run(): Promise<void> {
await this.getArgs()
const args: string[] = [
'--require-module',
'ts-node/register',
'--require',
'./features/**/*.js',
'--require',
'./node_modules/@dbspt/byte-core/src/**/*.js',
'--format',
'summary',
'--format',
'usage:report/cucumber-usage.txt',
'--format',
'json:report/cucumber-report.json',
'--format',
'html:report/cucumber-report.html',
'--publish-quiet',
'--parallel',
'3',
'--tags',
'@element_click_element',
]
spawnSync(
`${
process.platform === 'win32'
? '.\\node_modules\\.bin\\cucumber-js.cmd'
: './node_modules/.bin/cucumber-js'
}`,
args,
{ stdio: 'inherit' },
)
}
}
;(async () => {
console.log(`
▄▄▄▄· ▄· ▄▌▄▄▄▄▄▄▄▄ . ▄▄· ▄▄▄ ▄▄▄ .
▐█ ▀█▪▐█▪██▌•██ ▀▄.▀· ▐█ ▌▪▪ ▀▄ █·▀▄.▀·
▐█▀▀█▄▐█▌▐█▪ ▐█.▪▐▀▀▪▄ ██ ▄▄ ▄█▀▄ ▐▀▀▄ ▐▀▀▪▄
██▄▪▐█ ▐█▀·. ▐█▌·▐█▄▄▌ ▐███▌▐█▌.▐▌▐█•█▌▐█▄▄▌
·▀▀▀▀ ▀ • ▀▀▀ ▀▀▀ ·▀▀▀ ▀█▄▀▪.▀ ▀ ▀▀▀
${black.bgWhite(` BYTE CORE ${process.env.npm_package_version} `)}
`)
const byte = new Byte()
await byte.run()
})()