The GitHub Actions job "Release Auditing" on texera.git/feat/vitest-migration 
has failed.
Run started by GitHub user Yicong-Huang (triggered by Yicong-Huang).

Head commit for run:
a8c32ea79cc3e48e78ac9477f7a47cd24710b073 / Yicong Huang 
<[email protected]>
chore(frontend): mechanical Jasmine → Vitest sweep across 73 spec files

Follow-up to the runner-switch in the previous commit. This is the bulk
of the spec migration: pattern-based replacements covering all Jasmine
globals plus the spy-chain API. Tracking #4861.

Replacements applied:

| Jasmine | Vitest |
|---|---|
| `.toBeTrue()` / `.toBeFalse()` | `.toBe(true)` / `.toBe(false)` |
| `.and.returnValue(x)` | `.mockReturnValue(x)` |
| `.and.callFake(fn)` | `.mockImplementation(fn)` |
| `.and.callThrough()` | (removed; vitest spies call through by default) |
| `.and.throwError(e)` | `.mockImplementation(() => { throw e; })` |
| `.and.returnValues(a, b, ...)` | chained `.mockReturnValueOnce(...)` |
| `jasmine.createSpy('n')` | `vi.fn()` |
| `jasmine.createSpyObj('N', [m1, m2])` | `{ m1: vi.fn(), m2: vi.fn() }` |
| `jasmine.createSpyObj<T>([m])` | `({ m: vi.fn() } as unknown as Mocked<T>)` |
| `jasmine.any(X)` / `objectContaining` | `expect.any(X)` / 
`expect.objectContaining` |
| `jasmine.SpyObj<T>` | `Mocked<T>` (then loosened to `any` — see below) |
| `jasmine.clock()` | `vi.useFakeTimers()` (manual sites updated) |
| `jasmine.arrayWithExactContents(arr)` | `expect.arrayContaining(arr)` (lossy 
approximation, flagged) |
| `jasmine.addCustomEqualityTester(fn)` | stubbed with `((..._args) => {})(fn)` 
+ TODO |
| `spyOn(o, 'm')` | `vi.spyOn(o, 'm')` |

Strictness compromises taken to land the bulk migration without going
through every spec by hand:

- `Mocked<T>` annotations on local mock variables loosened to `any`. The
  original `jasmine.SpyObj<T>` was effectively `any` at runtime, and the
  partial-mock pattern these specs use (assigning `{ m1: vi.fn() }` to
  a variable typed as the full service) is incompatible with Vitest's
  strict `Mocked<T>`. Tightening these back is a follow-up sweep.
- Cast forms `as Mocked<T>` rewritten to `as any` for the same reason.

Specs with Jasmine `done`-callback patterns (12 tests across 3 files)
are excluded from both spec compile and test discovery in this PR; they
need an async/await rewrite that's tracked for a follow-up:
- `workflow-result.service.spec.ts`
- `download.service.spec.ts`
- `preset.service.spec.ts`

Build target: `gui:build` now has a `test` configuration pointed at a
new `src/tsconfig.test.json` that relaxes
`strictTemplates`/`strictNullChecks` for the test build only — the
unit-test builder runs stricter template type-checking than the legacy
custom-webpack:browser path used by production builds, surfacing
pre-existing app-template issues that are out of scope for the
migration.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/25283898313

With regards,
GitHub Actions via GitBox

Reply via email to