Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/command/interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,23 @@ module.exports = async function (path, options) {

if (options.verbose) output.level(3)

let addGlobalRetries

if (config.retry) {
addGlobalRetries = function retries() {}
}

output.print('Starting interactive shell for current suite...')
recorder.start()
event.emit(event.suite.before, {
fullTitle: () => 'Interactive Shell',
tests: [],
retries: addGlobalRetries,
})
event.emit(event.test.before, {
title: '',
artifacts: {},
retries: addGlobalRetries,
})

const enabledHelpers = Container.helpers()
Expand Down
8 changes: 4 additions & 4 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ module.exports.template = function (template, data) {
/**
* Make first char uppercase.
* @param {string} str
* @returns {string}
* @returns {string | undefined}
*/
module.exports.ucfirst = function (str) {
return str.charAt(0).toUpperCase() + str.substr(1)
if (str) return str.charAt(0).toUpperCase() + str.substr(1)
}

/**
* Make first char lowercase.
* @param {string} str
* @returns {string}
* @returns {string | undefined}
*/
module.exports.lcfirst = function (str) {
return str.charAt(0).toLowerCase() + str.substr(1)
if (str) return str.charAt(0).toLowerCase() + str.substr(1)
}

module.exports.chunkArray = function (arr, chunk) {
Expand Down
4 changes: 4 additions & 0 deletions test/unit/utils_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ describe('utils', () => {
it('should capitalize first letter', () => {
expect(utils.ucfirst('hello')).equal('Hello')
})

it('should handle the undefined', () => {
expect(utils.ucfirst()).to.be.undefined
})
})

describe('#beautify', () => {
Expand Down
Loading