(t *testing.T)
| 1186 | } |
| 1187 | |
| 1188 | func TestLoadingDynamicModel(t *testing.T) { |
| 1189 | app, _ := tests.NewTestApp() |
| 1190 | defer app.Cleanup() |
| 1191 | |
| 1192 | vm := goja.New() |
| 1193 | BindCore(vm) |
| 1194 | BindDbx(vm) |
| 1195 | vm.Set("$app", app) |
| 1196 | |
| 1197 | _, err := vm.RunString(` |
| 1198 | let result = new DynamicModel({ |
| 1199 | string: "", |
| 1200 | nullString: nullString(), |
| 1201 | nullStringEmpty: nullString(), |
| 1202 | |
| 1203 | bool: false, |
| 1204 | nullBool: nullBool(), |
| 1205 | nullBoolEmpty: nullBool(), |
| 1206 | |
| 1207 | int: 0, |
| 1208 | nullInt: nullInt(), |
| 1209 | nullIntEmpty: nullInt(), |
| 1210 | |
| 1211 | float: -0, |
| 1212 | nullFloat: nullFloat(), |
| 1213 | nullFloatEmpty: nullFloat(), |
| 1214 | |
| 1215 | array: [], |
| 1216 | nullArray: nullArray(), |
| 1217 | nullArrayEmpty: nullArray(), |
| 1218 | |
| 1219 | object: {}, |
| 1220 | nullObject: nullObject(), |
| 1221 | nullObjectEmpty: nullObject(), |
| 1222 | }) |
| 1223 | |
| 1224 | const expectations = { |
| 1225 | "string": "a", |
| 1226 | "nullString": "b", |
| 1227 | "nullStringEmpty": null, |
| 1228 | |
| 1229 | "bool": false, |
| 1230 | "nullBool": true, |
| 1231 | "nullBoolEmpty": null, |
| 1232 | |
| 1233 | "int": 1, |
| 1234 | "nullInt": 2, |
| 1235 | "nullIntEmpty": null, |
| 1236 | |
| 1237 | "float": 1.1, |
| 1238 | "nullFloat": 1.2, |
| 1239 | "nullFloatEmpty": null, |
| 1240 | |
| 1241 | "array": [1,2], |
| 1242 | "nullArray": [3,4], |
| 1243 | "nullArrayEmpty": null, |
| 1244 | |
| 1245 | "object": {a:1}, |
nothing calls this directly
no test coverage detected
searching dependent graphs…