just some little testing of json loading
This commit is contained in:
parent
9b04a90b53
commit
edc489ab1a
5 changed files with 39 additions and 8 deletions
|
@ -33,6 +33,13 @@ function test () {
|
|||
log("Value returned from additional module is correct");
|
||||
else
|
||||
log("Value returned from additional module is \"" + module + "\", which is incorrect");
|
||||
|
||||
const json = mimicry.getAsset("simple");
|
||||
if (json instanceof Object && json.I === "am")
|
||||
log("loaded by one of the modules asset (json) is present and valid");
|
||||
else
|
||||
log("loaded by one of the modules asset (json) is not present or invalid");
|
||||
|
||||
});
|
||||
log("Successfully launched Mimicry empty module");
|
||||
} catch (e) {
|
||||
|
|
|
@ -28,6 +28,12 @@ function test () {
|
|||
log("Value returned from additional module is correct");
|
||||
else
|
||||
log("Value returned from additional module is \"" + module + "\", which is incorrect");
|
||||
|
||||
const json = mimicry.getAsset("simple");
|
||||
if (json instanceof Object && json.I === "am")
|
||||
log("loaded by one of the modules asset (json) is present and valid");
|
||||
else
|
||||
log("loaded by one of the modules asset (json) is not present or invalid");
|
||||
});
|
||||
log("Successfully launched Mimicry empty module");
|
||||
} catch (e) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
"use strict";
|
||||
mimicry.module([
|
||||
"terminalModule",
|
||||
"simple", Mimicry.Type.json,
|
||||
"background", Mimicry.Type.css
|
||||
], function (global, [terminalModule]) {
|
||||
return terminalModule === "terminal";
|
||||
], function (global, [terminalModule, simple]) {
|
||||
return terminalModule === "terminal" && simple.a[4] === 115;
|
||||
});
|
10
test/simple.json
Normal file
10
test/simple.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"I": "am",
|
||||
"a": [
|
||||
"simple",
|
||||
true,
|
||||
true,
|
||||
"json",
|
||||
115
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue