Files
Simon Zünd aebbf4f106 [deps] Update 'eslint-plugin-jsdoc' to 46.10.1
This silences a warning because our Node engine is newer then the
package expects.

There are newer versions of the plugin by now, but the transitive
dependencies are younger than 1 week so the audit mirror blocks them.
46.10.1 seems like it was stable for a couple months so we use that.

R=alexrudenko@chromium.org

Bug: None
Change-Id: Icf1c1276852e55dcad97d2ea2eeb6a8d7a9d82ae
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5660063
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2024-06-27 09:26:18 +00:00

44 lines
2.1 KiB
TypeScript

import getParser from '../../src/parser/index.js';
import inspect from '../../src/stringifier/inspect.js';
import { seedBlock } from '../../src/util.js';
test('multiple lines', () => {
const source = `
/**
* Description may go\r\r
* over few lines followed by @tags\r
* @param {string} name name parameter
* @param {any} value value of any type
*/`.slice(1);
const parsed = getParser()(source);
const expected = `
|line|start|delimiter|postDelimiter|tag |postTag|name |postName|type |postType|description |end|CR |
|----|-----|---------|-------------|------|-------|-----|--------|--------|--------|--------------------------------|---|---|
| 0|{2} |/** | | | | | | | | | | |
| 1|{3} |* |{1} | | | | | | |Description may go | |{2}|
| 2|{3} |* |{1} | | | | | | |over few lines followed by @tags| |{1}|
| 3|{3} |* |{1} |@param|{1} |name |{1} |{string}|{1} |name parameter | | |
| 4|{3} |* |{1} |@param|{1} |value|{1} |{any} |{1} |value of any type | | |
| 5|{3} | | | | | | | | | |*/ | |`;
expect(inspect(parsed[0])).toEqual(expected.slice(1));
});
test('single line', () => {
const source = '/** @param {string} name name parameter */';
const parsed = getParser({ startLine: 12345 })(source);
const expected = `
|line |start|delimiter|postDelimiter|tag |postTag|name|postName|type |postType|description |end|CR|
|-----|-----|---------|-------------|------|-------|----|--------|--------|--------|---------------|---|--|
|12345| |/** |{1} |@param|{1} |name|{1} |{string}|{1} |name parameter |*/ | |`;
expect(inspect(parsed[0])).toEqual(expected.slice(1));
});
test('empty', () => {
const expected = '';
expect(inspect(seedBlock())).toEqual(expected.slice(1));
});