mirror of
https://github.com/zhigang1992/pocketbase-typegen.git
synced 2026-01-12 22:49:39 +08:00
* add geoPoint field * refactor dockerfile * update snapshots * fix integration tests * fix output directory
33 lines
832 B
JavaScript
33 lines
832 B
JavaScript
import assert from "node:assert"
|
|
import fs from "fs/promises"
|
|
|
|
// Known good types from repo
|
|
const controlTypes = await fs.readFile("../pocketbase-types-example.ts", {
|
|
encoding: "utf8",
|
|
})
|
|
|
|
async function testCreateFromUrl() {
|
|
const typesFromUrl = await fs.readFile("./output/pocketbase-types-url.ts", {
|
|
encoding: "utf8",
|
|
})
|
|
assert.equal(typesFromUrl, controlTypes)
|
|
}
|
|
|
|
async function testCreateFromEnv() {
|
|
const typesFromEnv = await fs.readFile("./output/pocketbase-types-env.ts", {
|
|
encoding: "utf8",
|
|
})
|
|
assert.equal(typesFromEnv, controlTypes)
|
|
}
|
|
|
|
async function testCreateFromDb() {
|
|
const typesFromDb = await fs.readFile("./output/pocketbase-types-db.ts", {
|
|
encoding: "utf8",
|
|
})
|
|
assert.equal(typesFromDb, controlTypes)
|
|
}
|
|
|
|
await testCreateFromUrl()
|
|
await testCreateFromDb()
|
|
await testCreateFromEnv()
|