jest
A jest test failure - the bullet header names the test, and the diff below it shows expected against received.
jstesttoolmatcher
Install: ci-doctor matchers add official/jest
matchers/js/jest/matcher.yaml
id: jestrole: toolclassification: [js, test]description: A jest test failure - the bullet header names the test, and the diff below it shows expected against received.start: ^\s*●|^FAIL\s+\S+\.(test|spec)\.[jt]sx?\bend: '^Tests:'
In bundles
Fixtures
Framing stripped per provider. Highlighted lines are what this matcher selects; the marked line is the anchor.
jest_test_failureOpen in playground
1Current runner version: '2.336.0'
2##[group]Operating System
3Ubuntu
424.04.4
5LTS
6##[endgroup]
7Secret source: Actions
8Prepare workflow directory
9Prepare all required actions
10Complete job name: jest_test_failure
11##[group]Set up job
12Image: ubuntu-24.04
13Runner name: 'GitHub Actions 12'
14##[endgroup]
15Download action repository 'actions/checkout@v4'
16Download action repository 'actions/cache@v4'
17##[group]Run actions/checkout@v4
18 with:
19 fetch-depth: 20
20 lfs: false
21##[endgroup]
22Syncing repository: acme/ledger
23##[group]Getting Git version info
24Working directory is '/home/runner/work/ledger/ledger'
25##[endgroup]
26/usr/bin/git checkout --progress --force 8ad41f02
27##[group]Run actions/cache@v4
28 with:
29 path: ~/.cache
30 key: Linux-deps-8ad41f02
31##[endgroup]
32Received 41943040 of 41943040 (100.0%), 40.0 MBs/sec
33Cache restored from key: Linux-deps-8ad41f02
34##[group]Run npm ci --no-audit --no-fund
35npm ci --no-audit --no-fund
36npx jest --ci --runInBand
37shell: /usr/bin/bash -e {0}
38##[endgroup]
39added 1902 packages in 24s
40PASS src/cart/totals.test.ts
41PASS src/cart/coupon.test.ts
42FAIL src/cart/discount.test.ts
43 ● Cart › applies a percentage discount to the subtotal
44
45 expect(received).toBe(expected) // Object.is equality
46
47 Expected: 2700
48 Received: 3000
49
50 14 | const cart = new Cart([{ sku: 'A-1', price: 3000 }]);
51 15 | cart.applyCoupon('SAVE10');
52 > 16 | expect(cart.total()).toBe(2700);
53 | ^
54 17 | });
55
56 at Object.<anonymous> (src/cart/discount.test.ts:16:26)
57
58 ● Cart › refuses a coupon past its expiry date
59
60 Received function did not throw
61
62 28 | cart.applyCoupon('EXPIRED2024');
63 > 29 | expect(() => cart.total()).toThrow(CouponExpiredError);
64 | ^
65
66 at Object.<anonymous> (src/cart/discount.test.ts:29:32)
67
68PASS src/checkout/session.test.ts
69Test Suites: 1 failed, 3 passed, 4 total
70Tests: 2 failed, 46 passed, 48 total
71Snapshots: 0 total
72Time: 11.402 s
73Ran all test suites.
74##[error]Process completed with exit code 1.
75##[group]Post Run actions/checkout@v4
76##[endgroup]
77/usr/bin/git version
78git version 2.54.0
79##[group]Post Run actions/upload-artifact@v4
80##[endgroup]
81Artifact upload complete.
82Post job cleanup.
83Cleaning up orphan processes
1Running with gitlab-runner 16.10.0 (be4e0e33)
2 on green-2.saas-linux-medium-amd64 Nb7Vc3Xq, system ID: s_1a2b3c4d5e6f
3Preparing the "docker+machine" executor
4 Using Docker executor with image node:20-alpine ...
5Resolving secrets
6Using Docker executor with image node:20-alpine ...
7Using docker image sha256:aabb1122ccdd for node:20-alpine with digest node@sha256:99ee...
8Preparing environment
9Running on runner-nb7vc3xq-project-42-concurrent-0...
10Fetching changes...
11Checking out 5c93de10 as detached HEAD...
12Checking cache for node-modules-20-default...
13Successfully extracted cache
14$ npm ci --no-audit --no-fund
15added 1902 packages in 24s
16$ npx jest --ci --runInBand
17PASS src/cart/totals.test.ts
18PASS src/cart/coupon.test.ts
19FAIL src/cart/discount.test.ts
20 ● Cart › applies a percentage discount to the subtotal
21
22 expect(received).toBe(expected) // Object.is equality
23
24 Expected: 2700
25 Received: 3000
26
27 14 | const cart = new Cart([{ sku: 'A-1', price: 3000 }]);
28 15 | cart.applyCoupon('SAVE10');
29 > 16 | expect(cart.total()).toBe(2700);
30 | ^
31 17 | });
32
33 at Object.<anonymous> (src/cart/discount.test.ts:16:26)
34
35 ● Cart › refuses a coupon past its expiry date
36
37 Received function did not throw
38
39 28 | cart.applyCoupon('EXPIRED2024');
40 > 29 | expect(() => cart.total()).toThrow(CouponExpiredError);
41 | ^
42
43 at Object.<anonymous> (src/cart/discount.test.ts:29:32)
44
45PASS src/checkout/session.test.ts
46Test Suites: 1 failed, 3 passed, 4 total
47Tests: 2 failed, 46 passed, 48 total
48Snapshots: 0 total
49Time: 11.402 s
50Ran all test suites.
51Running after_script
52$ echo "tests failed, skipping coverage upload"
53tests failed, skipping coverage upload
54Uploading artifacts for failed job
55Uploading artifacts as "archive" to coordinator... 201 Created
56ERROR: Job failed: exit code 1