• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 11939363921
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions-deps-2b1d353b35
DEFAULT BRANCH: master
Ran 20 Nov 2024 06:55PM UTC
Jobs 1
Files 608
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Nov 2024 06:18PM UTC coverage: 79.97% (-0.008%) from 79.978%
11939363921

push

github

web-flow
test(jest): replace mocha-chrome with jest TASK-1234 (#5264)

### 👀 Preview steps

- Check the CI log output — [✅ build
(20.17.0)](https://github.com/kobotoolbox/kpi/actions/runs/11822549230/job/32939829801?pr=5264)
- To run unit tests locally — use `npm run test` or `npm run test-watch`

### 💭 Notes

Port unit tests to a Jest runner instead of running them in
mocha-chrome.

- Internal discussion: [flaky "npm-test" CI
failure](https://chat.kobotoolbox.org/#narrow/stream/4-Kobo-Dev/topic/flaky.20.22npm-test.22.20CI.20failure)

- **🃏 Jest Configs** — Added jest/**mocha.config.ts**,
jest/**setupMochaTest.ts**, and jest/**coffeeTransformer.js**
- ☕ The custom transformer accommodates our rare combination of current
Jest with CoffeeScript 1.12.7. Easier than it seemed given good
examples, and I was glad it didn't need more code to interop with es
modules.
- 🎓 I used `@ts-expect-error` when setting up some globals for the test
environment. Lemme know if there's a more "correct" alternative, but I
think the effect is limited

- **🧰 Tests** - Changed test/**helper/fauxChai.coffee** and 4 other
**.tests.coffee** files in test/**xlform/**
- Added explicit `return` statements to fauxChai helpers and 4 other
test files
- Prevents CoffeeScript tests from implicitly returning objects, which
is interpreted as a test failure in the new Jest environment.
- See why Jest cares about this:
https://github.com/jestjs/jest/issues/6516#issuecomment-399539647
- Added explicit import for `_` in utils.tests.coffee, matching other
tests (instead of including it in the shared test environment)

- **🌐 Frontend** - Changed js/**constants.ts** 
- 🗨️ I added a check to prevent a `console.error` log from appearing if
test globals are present
- Otherwise the log appears frequently in the test logs, and may be
interpreted as a failed test

- **📦 Build** - Changed **package.json**, **package-lock.json**, and
scripts/**hints.js**
    - **"scripts... (continued)

5629 of 9091 branches covered (61.92%)

21544 of 26940 relevant lines covered (79.97%)

0.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 11939363921.1 20 Nov 2024 06:55PM UTC 0
79.97
Source Files on build 11939363921
Detailed source file information is not available for this build.
  • Back to Repo
  • a89df996 on github
  • Prev Build on main (#11935982013)
  • Next Build on main (#11940389211)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc