mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-17 22:03:56 -07:00
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
binaries/data/mods/public/globalscripts
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
36 lines
915 B
JavaScript
36 lines
915 B
JavaScript
const statusEffects = {
|
|
"test_A": {
|
|
"code": "test_a",
|
|
"statusName": "A",
|
|
"applierTooltip": "TTA"
|
|
},
|
|
"test_B": {
|
|
"code": "test_b",
|
|
"statusName": "B",
|
|
"applierTooltip": "TTB"
|
|
}
|
|
};
|
|
|
|
Engine.ListDirectoryFiles = () => Object.keys(statusEffects);
|
|
Engine.ReadJSONFile = (file) => statusEffects[file];
|
|
|
|
const sem = new StatusEffectsMetadata();
|
|
|
|
TS_ASSERT_UNEVAL_EQUALS(sem.getData("test_a"), {
|
|
"applierTooltip": "TTA",
|
|
"code": "test_a",
|
|
"icon": "default",
|
|
"statusName": "A",
|
|
"receiverTooltip": ""
|
|
});
|
|
TS_ASSERT_UNEVAL_EQUALS(sem.getData("test_b"), {
|
|
"applierTooltip": "TTB",
|
|
"code": "test_b",
|
|
"icon": "default",
|
|
"statusName": "B",
|
|
"receiverTooltip": ""
|
|
});
|
|
TS_ASSERT_UNEVAL_EQUALS(sem.getApplierTooltip("test_a"), "TTA");
|
|
TS_ASSERT_UNEVAL_EQUALS(sem.getIcon("test_b"), "default");
|
|
TS_ASSERT_UNEVAL_EQUALS(sem.getName("test_a"), "A");
|
|
TS_ASSERT_UNEVAL_EQUALS(sem.getReceiverTooltip("test_b"), "");
|