kunkun/apps/cli/__tests__/verify.test.ts
Huakun Shen 5ead38bf71
Add extension templates, create-kunkun and cli package (#26)
* chore: add extension templates

* feat: add create-kunkun and cli package

* fix: cli and create-kunkun package location

* fix: cli package test

* ci: run test for CI pipeline only on Linux

The most important E2E test is run with docker, Linux anyways, no need to run on Mac and Windows
2024-11-15 18:15:17 -05:00

31 lines
968 B
TypeScript

import { expect, test } from "bun:test"
import path from "path"
import { getRootDir } from "@/constants"
import fs from "fs-extra"
import { verifyCmd } from "../src/commands/verify"
const rootDir = getRootDir()
const extensionsDir = path.join(rootDir, "../../packages/extensions")
const templatesDir = path.join(rootDir, "../../templates")
const extsPaths = fs
.readdirSync(extensionsDir)
.map((extensionName) => path.join(extensionsDir, extensionName))
.filter((extPath) => fs.statSync(extPath).isDirectory())
const templatesPaths = fs
.readdirSync(templatesDir)
.map((templateName) => path.join(templatesDir, templateName))
.filter((extPath) => fs.statSync(extPath).isDirectory())
test("Verify Extensions", () => {
for (const extPath of extsPaths) {
expect(verifyCmd(extPath, false)).toBeTrue()
}
})
// test("Verify Templates", () => {
// for (const templatePath of templatesPaths) {
// expect(verifyCmd(templatePath, false)).toBeTrue()
// }
// })