import { getPluginOptionsMdString } from "../generate-plugin-options-docs"
import fs from "fs-extra"
import path from "path"

describe(`Plugin options docs`, () => {
  test(`Docs have been generated by running "yarn build" or "yarn generate-plugin-options-docs"`, async () => {
    const generatedDocsFileContents = await fs.readFile(
      path.join(__dirname, `../docs/plugin-options.md`),
      `utf-8`
    )

    const mdString = await getPluginOptionsMdString()

    expect(generatedDocsFileContents).toBeTruthy()
    expect(mdString).toBeTruthy()

    expect(generatedDocsFileContents).toEqual(mdString)
  })
})
