mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 14:29:25 +02:00
Merge branch 'develop' into 6584-piechart-zero-negative-values
This commit is contained in:
@@ -3,7 +3,7 @@ import "../common/common";
|
||||
|
||||
entry Packet:
|
||||
NEWLINE*
|
||||
"packet-beta"
|
||||
("packet"| "packet-beta")
|
||||
(
|
||||
TitleAndAccessibilities
|
||||
| blocks+=PacketBlock
|
||||
|
@@ -2,6 +2,6 @@ import { AbstractMermaidTokenBuilder } from '../common/index.js';
|
||||
|
||||
export class PacketTokenBuilder extends AbstractMermaidTokenBuilder {
|
||||
public constructor() {
|
||||
super(['packet-beta']);
|
||||
super(['packet']);
|
||||
}
|
||||
}
|
||||
|
@@ -11,6 +11,12 @@ describe('packet', () => {
|
||||
`
|
||||
\tpacket-beta
|
||||
`,
|
||||
`packet`,
|
||||
` packet `,
|
||||
`\tpacket\t`,
|
||||
`
|
||||
\tpacket
|
||||
`,
|
||||
])('should handle regular packet', (context: string) => {
|
||||
const result = parse(context);
|
||||
expectNoErrorsOrAlternatives(result);
|
||||
|
@@ -32,15 +32,10 @@ const consoleMock = vi.spyOn(console, 'log').mockImplementation(() => undefined)
|
||||
* @param result - the result `parse` function.
|
||||
*/
|
||||
export function expectNoErrorsOrAlternatives(result: ParseResult) {
|
||||
if (result.lexerErrors.length > 0) {
|
||||
// console.debug(result.lexerErrors);
|
||||
}
|
||||
if (result.parserErrors.length > 0) {
|
||||
// console.debug(result.parserErrors);
|
||||
}
|
||||
expect(result.lexerErrors).toHaveLength(0);
|
||||
expect(result.parserErrors).toHaveLength(0);
|
||||
|
||||
expect.soft(result.lexerErrors).toHaveLength(0);
|
||||
expect.soft(result.parserErrors).toHaveLength(0);
|
||||
// To see what the error is, in the logs.
|
||||
expect(result.lexerErrors[0]).toBeUndefined();
|
||||
expect(consoleMock).not.toHaveBeenCalled();
|
||||
consoleMock.mockReset();
|
||||
}
|
||||
|
Reference in New Issue
Block a user