@canvasengine/compiler 2.0.0-beta.7 → 2.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/grammar.pegjs +1 -1
- package/package.json +1 -1
- package/tests/compiler.spec.ts +6 -6
package/grammar.pegjs
CHANGED
package/package.json
CHANGED
package/tests/compiler.spec.ts
CHANGED
|
@@ -123,18 +123,18 @@ describe("Compiler", () => {
|
|
|
123
123
|
expect(output).toBe(`h(Canvas, { width: computed(() => x() * 2 * y()) })`);
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
test("should compile component with static numeric attribute", () => {
|
|
127
|
-
const input = `<Canvas width="10" />`;
|
|
128
|
-
const output = parser.parse(input);
|
|
129
|
-
expect(output).toBe(`h(Canvas, { width: 10 })`);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
126
|
test("should compile component with static string attribute", () => {
|
|
133
127
|
const input = `<Canvas width="val" />`;
|
|
134
128
|
const output = parser.parse(input);
|
|
135
129
|
expect(output).toBe(`h(Canvas, { width: 'val' })`);
|
|
136
130
|
});
|
|
137
131
|
|
|
132
|
+
test("should compile component with static attribute (with number)", () => {
|
|
133
|
+
const input = `<Canvas width="10" />`;
|
|
134
|
+
const output = parser.parse(input);
|
|
135
|
+
expect(output).toBe(`h(Canvas, { width: '10' })`);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
138
|
test("should compile component with children", () => {
|
|
139
139
|
const input = `
|
|
140
140
|
<Canvas>
|