Skip to content

Commit

Permalink
Feedback changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sainthkh committed Jan 6, 2022
1 parent 72760a4 commit 152e6df
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/driver/src/cy/commands/aliasing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function (Commands, Cypress, cy, state) {
})
}

// TODO: Change any to Log type.
// TODO: change the log type from `any` to `Log`.
// we also need to set the alias on the last command log
// that matches our chainerId
const log: any = _.last(cy.queue.logs({
Expand Down
1 change: 1 addition & 0 deletions packages/driver/src/cy/commands/angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default (Commands, Cypress, cy, state) => {
}

Commands.addAll({
// TODO: Change the options type from `any` to `Partial<Cypress.Loggable & Cypress.Timeoutable>`.
ng (type, selector, options: any = {}) {
const userOptions = options

Expand Down
4 changes: 2 additions & 2 deletions packages/driver/src/cy/commands/asserting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function (Commands, Cypress, cy, state) {

const shouldFn = function (subject, chainers, ...args) {
if (_.isFunction(chainers)) {
return shouldFnWithCallback.apply(this, [subject, chainers]) // eslint-disable-line prefer-rest-params
return shouldFnWithCallback.apply(this, [subject, chainers])
}

let exp = cy.expect(subject).to
Expand All @@ -38,7 +38,7 @@ export default function (Commands, Cypress, cy, state) {
const log = Cypress.log({
name: 'should',
type: 'child',
message: ([] as any).concat(originalChainers, args),
message: ([] as any[]).concat(originalChainers, args),
end: true,
snapshot: true,
error: err,
Expand Down
8 changes: 4 additions & 4 deletions packages/driver/src/cy/commands/clock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function (Commands, Cypress, cy, state) {
})

return Commands.addAll({ type: 'utility' }, {
// TODO: change the type of `any` to Loggable.
// TODO: change the options type from `any` to Partial<Loggable>.
clock (subject, now, methods, options: any = {}) {
let userOptions = options
const ctx = state('ctx')
Expand Down Expand Up @@ -77,7 +77,7 @@ export default function (Commands, Cypress, cy, state) {
log: true,
})

const log = (name, message?, snapshot = true, consoleProps = {}) => {
const log = (name, message = '', snapshot = true, consoleProps = {}) => {
if (!options.log) {
return
}
Expand Down Expand Up @@ -138,7 +138,7 @@ export default function (Commands, Cypress, cy, state) {

const { restore } = clock

clock.restore = function (options: any = {}) {
clock.restore = function (options: Partial<Cypress.Loggable> = {}) {
const ret = restore.apply(this)

if (options.log !== false) {
Expand All @@ -163,7 +163,7 @@ export default function (Commands, Cypress, cy, state) {
return clock
},

tick (subject, ms, options = {}) {
tick (subject, ms, options: Partial<Cypress.Loggable> = {}) {
if (!clock) {
$errUtils.throwErrByPath('tick.no_clock')
}
Expand Down
2 changes: 1 addition & 1 deletion packages/driver/src/cy/commands/debugging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default (Commands, Cypress, cy, state, config) => {
})

Commands.addAll({ type: 'utility', prevSubject: 'optional' }, {
// TODO: change `any` to Loggable
// TODO: change the options type from `any` to `Loggable`.
// pause should indefinitely pause until the user
// presses a key or clicks in the UI to continue
pause (subject, options: any = {}) {
Expand Down

0 comments on commit 152e6df

Please sign in to comment.