Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Docs: Expect helper config example fails in 4.x, and the sidebar links to the old 3.x page

未关闭 适合新手
#5,773 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
领域
documentation

调研方向

阅读引用的侧边栏条目附近的 docs/assertions.md、docs/helpers/ExpectHelper.md 和 astro.config.mjs;将过时的 src/content/docs/helpers/expect.md 与当前的 expect-helper 页面进行核对。更新 Expect Helper 示例,使其使用 issue 中所示的 package 配置,并将侧边栏指向当前页面。当文档中的两个示例都能在 4.x package 配置下加载,且侧边栏链接到当前页面时,即为完成。

由索引模型根据 Issue 内容生成。

描述

In 4.x the Expect helper is no longer built in; it is the separate package @codeceptjs/expect-helper. The docs still show the 3.x config, which fails to load in 4.x.

1. The config example is wrong

https://codecept.io/helpers/expect-helper and the "Quick Assertions with Expect Helper" section of https://codecept.io/assertions both show:

helpers: {
  Playwright: { /* ... */ },
  ExpectHelper: {},
}

Without require, getHelperModuleName() in lib/container.js resolves the key to the built-in path ./helper/ExpectHelper, which doesn't exist in 4.x. Either of these works:

ExpectHelper: { require: '@codeceptjs/expect-helper' },
// or, because a key starting with @codeceptjs/ is used as the module name:
'@codeceptjs/expect-helper': {},

Sources:

  • docs/assertions.md (around line 100)
  • docs/helpers/ExpectHelper.md, which is generated from the JSDoc example in codeceptjs/expect-helper index.js ("Zero-configuration when paired with other helpers..."). The package's own README already shows the require form.

2. The sidebar links to the old 3.x page

The "Expect" item under Helpers points to https://codecept.io/helpers/expect, an older copy of the page (title "Expect", config Expect: {}). The current page is https://codecept.io/helpers/expect-helper, which the sidebar doesn't link to.

In codeceptjs/website:

  • astro.config.mjs:311: {label: 'Expect', link: 'helpers/expect'}
  • src/content/docs/helpers/expect.md is the stale page. expect-helper.md is the one synced from [email protected].

Environment: CodeceptJS 4.2.2, @codeceptjs/expect-helper 1.0.2


Created by AI agent (Claude Code)

主要语言
JavaScript
星标
4.2k
派生
754
平均合并
2 天 11 小时
30 天内合并 PR
33

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codeceptjs/CodeceptJS 的其他 Issue

查看 codeceptjs/CodeceptJS 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。