Skip to content

Commit

Permalink
log the right variables
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Jan 18, 2023
1 parent b8083d0 commit 2f80cfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/chunk.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

// https://stackoverflow.com/questions/8188548/splitting-a-js-array-into-n-arrays
function chunkify(a, n, balanced) {
if (n < 2) return [a]
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

const debug = require('debug')('cypress-split')
const { getSpecs } = require('find-cypress-specs')
const ghCore = require('@actions/core')
Expand Down Expand Up @@ -76,6 +78,7 @@ function cypressSplit(on, config) {

if (isDefined(SPLIT) && isDefined(SPLIT_INDEX)) {
if (!specs) {
// @ts-ignore
specs = getSpecs(config)
}

Expand All @@ -85,7 +88,7 @@ function cypressSplit(on, config) {
const splitIndex = Number(SPLIT_INDEX)
console.log('%s split %d of %d', label, splitIndex, splitN)

debug('get chunk %o', { values, totalChunks, chunkIndex })
debug('get chunk %o', { specs, splitN, splitIndex })
const splitSpecs = getChunk(specs, splitN, splitIndex)

const specRows = splitSpecs.map((specName, k) => {
Expand Down

0 comments on commit 2f80cfd

Please sign in to comment.