Initial import with skill sheet working
This commit is contained in:
70
node_modules/comment-parser/tests/unit/transforms-crlf.spec.ts
generated
vendored
Normal file
70
node_modules/comment-parser/tests/unit/transforms-crlf.spec.ts
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user