Files
react-native-devtools-frontend/node_modules/comment-parser/tests/unit/transforms-crlf.spec.ts
T
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

71 lines
1.0 KiB
TypeScript

import crlf, { Ending } from '../../src/transforms/crlf.js';
import getParser, { Parser } from '../../src/parser/index.js';
import getStringifier, { Stringifier } from '../../src/stringifier/index.js';
const tests = [
[
'no CR',
'CRLF',
`
/**
* description
*
*/`,
`
/**\r
* description\r
*\r
*/\r`,
],
[
'mixed',
'CRLF',
`
/**
* description
*\r
*/`,
`
/**\r
* description\r
*\r
*/\r`,
],
[
'no CR',
'LF',
`
/**
* description
*
*/`,
`
/**
* description
*
*/`,
],
[
'mixed',
'LF',
`
/**
* description
*\r
*/`,
`
/**
* description
*
*/`,
],
];
test.each(tests)('CRLF - %s to %s', (name, mode, source, expected) => {
expected = expected.slice(1);
const parsed = getParser()(source);
const normalized = crlf(mode as Ending)(parsed[0]);
const out = getStringifier()(normalized);
expect(out).toBe(expected);
});