Skip to content

Instantly share code, notes, and snippets.

@zaydek-old
Created October 27, 2019 01:05
Show Gist options
  • Save zaydek-old/e735dc57ed29dea79b3f0cc222e8017a to your computer and use it in GitHub Desktop.
Save zaydek-old/e735dc57ed29dea79b3f0cc222e8017a to your computer and use it in GitHub Desktop.
import fs from "fs"
import puppeteer from "puppeteer"
import React from "react"
import ReactDOM from "react-dom"
const headless = true
const selector = "article[contenteditable]"
const delay = 0
const text = fs.readFileSync("./src/components/test.md", "utf8")
jest.setTimeout(180e3)
test("test.md", async () => {
const browser = await puppeteer.launch({ headless })
const page = await browser.newPage()
page.on("pageerror", error => expect(error).toBeNull())
await page.setViewport({ width: 1440, height: 900 })
await page.goto("http://localhost:3000", { timeout: 1e3 })
await page.addScriptTag({ path: "./src/components/innerText.min.js" })
await page.waitFor(1e3)
await page.focus(selector)
await page.keyboard.type(text, { delay })
await page.waitFor(100)
const innerText = await page.$eval(selector, node => innerText(node))
expect(innerText).toBe(text)
await browser.close()
})

Text \escape emphasis strong code link.

Text \escape emphasis strong code link.

Text \escape emphasis strong code link.

Text \escape emphasis strong code link.

Text \escape emphasis strong code link.
Text \escape emphasis strong code link.

/*

// Text \escape emphasis strong code link. Text // \escape emphasis strong code link. Text \escape // emphasis strong code link. Text \escape emphasis // strong code link. Text \escape emphasis strong // code link. Text \escape emphasis strong code // link.

*/

Text \escape emphasis strong code link. Text \escape emphasis strong code link. Text \escape emphasis strong code link. Text \escape emphasis strong code link. Text \escape emphasis strong code link. Text \escape emphasis strong code link.

package main

import "fmt"

func main() {
  fmt.Println("Text \escape _emphasis_ **strong** `code` [link](href).")
  fmt.Println("Text \escape _emphasis_ **strong** `code` [link](href).")
  fmt.Println("Text \escape _emphasis_ **strong** `code` [link](href).")
  fmt.Println("Text \escape _emphasis_ **strong** `code` [link](href).")
  fmt.Println("Text \escape _emphasis_ **strong** `code` [link](href).")
  fmt.Println("Text \escape _emphasis_ **strong** `code` [link](href).")
}

Text \escape emphasis strong code link. Text \escape emphasis strong code link. Text \escape emphasis strong code link. Text \escape emphasis strong code link. Text \escape emphasis strong code link. Text \escape emphasis strong code link.

  • Text \escape emphasis strong code link.
  • Text \escape emphasis strong code link.
  • Text \escape emphasis strong code link.
  • Text \escape emphasis strong code link.
  • Text \escape emphasis strong code link.
  • Text \escape emphasis strong code link.
  1. Text \escape emphasis strong code link.
  2. Text \escape emphasis strong code link.
  3. Text \escape emphasis strong code link.
  4. Text \escape emphasis strong code link.
  5. Text \escape emphasis strong code link.
  6. Text \escape emphasis strong code link.






Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment