Improve type-safety of the TokenBuilder's options #2445
Annotations
10 errors and 1 warning
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = \'a\';\n\nexport func…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = 'a';
export function isA(item: unknown): item is A {
return item === 'a';
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = \'a\' | \'b\' | \'c\'…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = 'a' | 'b' | 'c';
export function isA(item: unknown): item is A {
return item === 'a' || item === 'b' || item === 'c';
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = \'a\';\n\nexport func…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = 'a';
export function isA(item: unknown): item is A {
return item === 'a';
}
export type AB = 'b' | A;
export function isAB(item: unknown): item is AB {
return isA(item) || item === 'b';
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = string;\n\nexport fun…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = string;
export function isA(item: unknown): item is A {
return (typeof item === 'string' && (/[_a-zA-Z][\w_]*/.test(item)));
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = string;\n\nexport fun…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = string;
export function isA(item: unknown): item is A {
return (typeof item === 'string' && (/[_a-zA-Z][\w_]*/.test(item) || /"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/.test(item)));
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = \'a\';\n\nexport func…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = 'a';
export function isA(item: unknown): item is A {
return item === 'a';
}
export type ABC = (B | C) | A;
export function isABC(item: unknown): item is ABC {
return isA(item) || isB(item) || isC(item);
}
export type B = 'b';
export function isB(item: unknown): item is B {
return item === 'b';
}
export type C = 'c';
export function isC(item: unknown): item is C {
return item === 'c';
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = string;\n\nexport fun…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = string;
export function isA(item: unknown): item is A {
return typeof item === 'string';
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = number;\n\nexport fun…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = number;
export function isA(item: unknown): item is A {
return typeof item === 'number';
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = number;\n\nexport fun…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = number;
export function isA(item: unknown): item is A {
return typeof item === 'number';
}
export interface Node extends AstNode {
readonly $type: 'Node';
num: A;
}
export const Node = 'Node';
export function isNode(item: unknown): item is Node {
return reflection.isInstance(item, Node);
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
packages/langium-cli/test/generator/ast-generator.test.ts#L482
AssertionError: expected 'export type testTerminalNames = keyof…' to deeply equal 'export type A = number;\n\nexport fun…'
- Expected
+ Received
+ export type testTerminalNames = keyof typeof testTerminals;
+
export type A = number;
export function isA(item: unknown): item is A {
return typeof item === 'number';
}
export interface Node extends AstNode {
readonly $type: 'Node';
num: Array<A>;
}
export const Node = 'Node';
export function isNode(item: unknown): item is Node {
return reflection.isInstance(item, Node);
}
❯ packages/langium-cli/test/generator/ast-generator.test.ts:482:30
|
The following actions uses Node.js version which is deprecated and will be forced to run on node20: actions/checkout@v3, actions/setup-node@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
This job failed
Loading