-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: adding preview command * update the variable name * move specs * move CI detection * more work * remove comments * move finding specs * getting specs * move the code * demo preview * add to README * chunk index
- Loading branch information
Showing
7 changed files
with
339 additions
and
160 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env node | ||
|
||
// @ts-check | ||
|
||
const arg = require('arg') | ||
const debug = require('debug')('cypress-split') | ||
const label = 'cypress-split-preview' | ||
const { version } = require('../package.json') | ||
const { getSpecsToSplit } = require('../src/parse-inputs') | ||
const { splitSpecsLogic } = require('../src/utils') | ||
|
||
console.log('%s Version %s', label, version) | ||
|
||
const args = arg({ | ||
'--split': Number, | ||
'--split-file': String, | ||
}) | ||
debug(args) | ||
|
||
const n = args['--split'] | ||
console.log('%s split %d ways', label, n) | ||
const specs = getSpecsToSplit(process.env) | ||
console.log('%s found %d specs', label, specs.length) | ||
debug(specs) | ||
|
||
if (typeof n !== 'number') { | ||
throw new Error('Please provide --split N') | ||
} | ||
|
||
for (let k = 0; k < n; k += 1) { | ||
console.log('%s chunk %d of %d', label, k + 1, n) | ||
splitSpecsLogic({ | ||
specs, | ||
splitN: n, | ||
splitIndex: k, | ||
splitFileName: args['--split-file'], | ||
label, | ||
}) | ||
} |
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
Oops, something went wrong.