arunkumar
4 years ago
3 changed files with 1439 additions and 337 deletions
File diff suppressed because it is too large
@ -0,0 +1,18 @@ |
|||
const expect = require("chai").expect; |
|||
const CompileReact = require("../lib/compileReact"); |
|||
const { render, screen } = require("@testing-library/react"); |
|||
// require("@testing-library/jest-dom/extend-expect");
|
|||
require("jsdom"); |
|||
|
|||
describe("Compile AST to REACT elements", function () { |
|||
it("Simple react elements", function () { |
|||
const ast = [ |
|||
{ |
|||
type: "underline", |
|||
children: ["The ", { type: "bold", children: ["Apple"] }], |
|||
}, |
|||
]; |
|||
render(CompileReact(ast)); |
|||
expect(screen.getByText("Apple")).toHaveTextContent("Apple"); |
|||
}); |
|||
}); |
Loading…
Reference in new issue