it("should init the base field with the given app",()=>
withRunningApp(
(app_class:TestAppConstructor)=>{
returnclassextendsapp_class{
collections={
...TestApp.BaseCollections,
A:new(classextendsCollection{
fields={
simple:newFieldTypes.Text(),
derived:newFieldTypes.DerivedValue(
newFieldTypes.SingleReference("A"),
{
fields:["simple"],
deriving_fn:async(_,__,_simple)=>{
return"any_id";// this isn't a proper ID, and the SingleReference should detect that by being able to access the `this.app` instance and reading the database. If any other error than "bad id" will be thrown, it means that the base field is not initiated properly