Analyzes source code and auto-generates comprehensive unit and integration tests.
Check: package.json (jest/mocha), pytest.ini, pyproject.toml, conftest.py
Read source files. Identify: function signatures, parameters, return types, error handling, edge cases.
For each function generate: happy path, edge cases (empty/null/zero), error cases, boundary cases.
JavaScript: __tests__/filename.test.js or filename.test.js
Python: tests/test_filename.py
describe('functionName', () => {
test('should return expected result', () => {
expect(functionName(input)).toBe(expected);
});
test('should throw for invalid input', () => {
expect(() => functionName(invalid)).toThrow();
});
});
def test_function_normal():
assert function_name(input) == expected
def test_function_invalid():
with pytest.raises(ErrorType):
function_name(invalid)
共 1 个版本