mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-22 03:10:43 +08:00
Enhance architecture documentation and update project dependencies. Introduce new features for browser recording, page callables, and transform capabilities. Improve build scripts and permissions for better functionality.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { parseFunctionParameterNames } from './function-parameters';
|
||||
|
||||
describe('deep-capture function parameter parser', () => {
|
||||
it.each([
|
||||
['async function buildLoginEnvelope(password, account = "analyst") {}', ['password', 'account']],
|
||||
['encrypt(value, options = { mode: "CBC", fields: ["a", "b"] }) {}', ['value', 'options']],
|
||||
['(payload, ...rest) => payload', ['payload', 'rest']],
|
||||
['async value => value', ['value']],
|
||||
['function transform({ value }, [key]) {}', ['arg0', 'arg1']],
|
||||
])('reads runtime source parameters from %s', (source, expected) => {
|
||||
expect(parseFunctionParameterNames(source)).toEqual(expected);
|
||||
});
|
||||
|
||||
it('keeps the parser bounded', () => {
|
||||
expect(parseFunctionParameterNames('(a, b, c) => a', 2)).toEqual(['a', 'b']);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user