Loading...
Loading...
Verify compat PR claims by running lodash vs es-toolkit/compat at runtime
npx skill4agent add toss/es-toolkit compat-review1234chunkgh pr view {number} --repo toss/es-toolkit --json title,body,filessrc/compat/{category}/_compat-review-{fn}.spec.tsimport { describe, expect, it } from 'vitest';
import { fn as compatFn } from 'es-toolkit/compat';
import { fn as lodashFn } from 'lodash';[]{}''0nullundefined-101.5NaNInfinity'3'it('description', () => {
let lodashResult, compatResult;
let lodashErr: any, compatErr: any;
try {
lodashResult = lodashFn(args);
} catch (e) {
lodashErr = e;
}
try {
compatResult = compatFn(args);
} catch (e) {
compatErr = e;
}
if (lodashErr && compatErr) return; // both throw = consistent
if (lodashErr || compatErr) {
throw new Error(`Behavior mismatch: ${lodashErr ? 'lodash throws' : 'compat throws'}`);
}
expect(compatResult).toEqual(lodashResult);
});yarn vitest run src/compat/{category}/_compat-review-{fn}.spec.tsgh pr diff {number} --repo toss/es-toolkit | git applygit checkout -- ._compat-review-*.spec.ts## {fn} — Compat Review
### PR Claim
{What the contributor says they're fixing}
### Verification (BEFORE fix)
| # | Input | lodash | compat | Match? | Source |
|---|-------|--------|--------|--------|--------|
| 1 | ... | ... | ... | MISMATCH | PR example |
| 2 | ... | ... | ... | MATCH | Edge case |
### Verification (AFTER fix)
| # | Input | lodash | compat | Match? | Source |
|---|-------|--------|--------|--------|--------|
### Verdict
- [ ] PR claim is valid (inconsistency confirmed on main)
- [ ] Fix resolves the claimed inconsistency
- [ ] No regressions in edge cases
- [ ] Existing tests still pass