Allow for passing model entities as objects #605
validate.yml
on: pull_request
validate
/
Linting
9s
validate
/
Testing
7s
Annotations
2 errors
error: expect(received).toEqual(expected):
tests/meta.test.ts#L112
[
{
params: [],
statement: "CREATE TABLE \"accounts\" (\"id\" TEXT PRIMARY KEY DEFAULT ('acc_' || lower(substr(hex(randomblob(12)), 1, 16))), \"ronin.createdAt\" DATETIME DEFAULT (strftime('%Y-%m-%dT%H:%M:%f', 'now') || 'Z'), \"ronin.createdBy\" TEXT, \"ronin.updatedAt\" DATETIME DEFAULT (strftime('%Y-%m-%dT%H:%M:%f', 'now') || 'Z'), \"ronin.updatedBy\" TEXT, \"handle\" TEXT, \"email\" TEXT UNIQUE NOT NULL COLLATE NOCASE CHECK (length(\"handle\") >= 3), \"position\" INTEGER AUTOINCREMENT, \"name\" TEXT GENERATED ALWAYS AS (UPPER(substr(\"handle\", 1, 1)) || substr(\"handle\", 2)) STORED)",
},
{
params: [],
+ statement: "CREATE UNIQUE INDEX \"index_slug\" ON \"undefined\" (\"handle\")",
+ },
+ {
+ params: [],
+ statement: "DROP TABLE \"signups\"",
+ },
+ {
+ params: [],
+ statement: "DROP TABLE \"undefined\"",
+ },
+ {
+ params: [],
+ statement: "CREATE TRIGGER \"trigger_slug\" AFTER INSERT ON \"undefined\" BEGIN INSERT INTO \"signups\" (\"year\") VALUES (2000); END",
- statement: "CREATE UNIQUE INDEX \"index_slug\" ON \"accounts\" (\"handle\")",
},
{
params: [],
+ statement: "DROP TABLE \"signups\"",
+ },
+ {
+ params: [],
+ statement: "DROP TABLE \"undefined\"",
- statement: "CREATE TRIGGER \"trigger_slug\" AFTER INSERT ON \"accounts\" BEGIN INSERT INTO \"signups\" (\"year\") VALUES (2000); END",
},
{
params: [
"account",
"{\"id\":{\"name\":\"ID\",\"type\":\"string\",\"slug\":\"id\",\"defaultValue\":{\"__RONIN_EXPRESSION\":\"'acc_' || lower(substr(hex(randomblob(12)), 1, 16))\"}},\"ronin.createdAt\":{\"name\":\"RONIN - Created At\",\"type\":\"date\",\"slug\":\"ronin.createdAt\",\"defaultValue\":{\"__RONIN_EXPRESSION\":\"strftime('%Y-%m-%dT%H:%M:%f', 'now') || 'Z'\"}},\"ronin.createdBy\":{\"name\":\"RONIN - Created By\",\"type\":\"string\",\"slug\":\"ronin.createdBy\"},\"ronin.updatedAt\":{\"name\":\"RONIN - Updated At\",\"type\":\"date\",\"slug\":\"ronin.updatedAt\",\"defaultValue\":{\"__RONIN_EXPRESSION\":\"strftime('%Y-%m-%dT%H:%M:%f', 'now') || 'Z'\"}},\"ronin.updatedBy\":{\"name\":\"RONIN - Updated By\",\"type\":\"string\",\"slug\":\"ronin.updatedBy\"},\"handle\":{\"type\":\"string\",\"name\":\"Handle\"},\"email\":{\"type\":\"string\",\"required\":true,\"unique\":true,\"check\":{\"__RONIN_EXPRESSION\":\"length(__RONIN_FIELD_handle) >= 3\"},\"collation\":\"NOCASE\",\"name\":\"Email\"},\"position\":{\"type\":\"number\",\"increment\":true,\"name\":\"Position\"},\"name\":{\"type\":\"string\",\"computedAs\":{\"kind\":\"STORED\",\"value\":{\"__RONIN_EXPRESSION\":\"UPPER(substr(__RONIN_FIELD_handle, 1, 1)) || substr(__RONIN_FIELD_handle, 2)\"}},\"name\":\"Name\"}}",
"{\"indexSlug\":{\"fields\":[{\"slug\":\"handle\"}],\"unique\":true}}",
"{\"triggerSlug\":{\"when\":\"AFTER\",\"action\":\"INSERT\",\"effects\":[{\"add\":{\"signup\":{\"with\":{\"year\":2000}}}}]}}",
"{\"companyEmployees\":{\"instructions\":{\"with\":{\"email\":{\"endingWith\":\"@company.co\"}}}}}",
+ "mod_f7b6bc58ae45bd69",
- StringMatching /[a-z]{3}_[a-z0-9]{16}/,
"accounts",
"Account",
"Accounts",
"acc",
"accounts",
"id",
"id"
],
returning: true,
statement: "INSERT INTO \"ronin_schema\" (\"slug\", \"fields\", \"indexes\", \"triggers\", \"presets\", \"id\", \"pluralSlug\", \"name\", \"pluralName\", \"idPrefix\", \"table\", \"identifiers.name\", \"identifiers.slug\") VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13) RETURNING \"id\", \"ronin.createdAt\", \"ronin.createdBy\", \"ronin.updatedAt\", \"ronin.updatedBy\", \"name\", \"pluralName\", \"slug\", \"pluralSlug\", \"idPrefix\", \"table\", \"identifiers.name\", \"identifiers.slug\", \"fields\", \"indexes\", \"triggers\", \"presets\"",
}
]
- Expected - 3
+ Received + 19
at /home/runner/work/compiler/compiler/tests/meta.test.ts:112:34
|
validate / Testing
Process completed with exit code 1.
|