Skip to content

Commit

Permalink
Use satisfies as opposed to as
Browse files Browse the repository at this point in the history
`as` doesn't at all do what I was somehow hoping for here.
  • Loading branch information
badeball committed Nov 2, 2023
1 parent 0a5ea70 commit ce02587
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions lib/browser-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function taskSpecEnvelopes(context: CompositionContext) {
if (shouldPropagateMessages(context)) {
cy.task(
TASK_SPEC_ENVELOPES,
{ messages: context.specEnvelopes } as ITaskSpecEnvelopes,
{ messages: context.specEnvelopes } satisfies ITaskSpecEnvelopes,
{
log: false,
}
Expand All @@ -152,9 +152,13 @@ function taskTestCaseStarted(
testCaseStarted: messages.TestCaseStarted
) {
if (shouldPropagateMessages(context)) {
cy.task(TASK_TEST_CASE_STARTED, testCaseStarted as ITaskTestCaseStarted, {
log: false,
});
cy.task(
TASK_TEST_CASE_STARTED,
testCaseStarted satisfies ITaskTestCaseStarted,
{
log: false,
}
);
}
}

Expand All @@ -165,7 +169,7 @@ function taskTestCaseFinished(
if (shouldPropagateMessages(context)) {
cy.task(
TASK_TEST_CASE_FINISHED,
testCasefinished as ITaskTestCaseFinished,
testCasefinished satisfies ITaskTestCaseFinished,
{
log: false,
}
Expand All @@ -178,9 +182,13 @@ function taskTestStepStarted(
testStepStarted: messages.TestStepStarted
) {
if (shouldPropagateMessages(context)) {
cy.task(TASK_TEST_STEP_STARTED, testStepStarted as ITaskTestStepStarted, {
log: false,
});
cy.task(
TASK_TEST_STEP_STARTED,
testStepStarted satisfies ITaskTestStepStarted,
{
log: false,
}
);
}
}

Expand All @@ -191,7 +199,7 @@ function taskTestStepFinished(
if (shouldPropagateMessages(context)) {
cy.task(
TASK_TEST_STEP_FINISHED,
testStepfinished as ITaskTestStepFinished,
testStepfinished satisfies ITaskTestStepFinished,
{
log: false,
}
Expand Down

0 comments on commit ce02587

Please sign in to comment.