0ad/binaries/data/mods/public/globalscripts/tests/test_AttackEffects.js
Ralph Sennhauser 0791504491
Fix eslint rule 'prefer-const' in globalscripts
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>
2025-05-06 14:16:42 +02:00

31 lines
525 B
JavaScript

const effects = {
"eff_A": {
"code": "a",
"name": "A",
"order": "2",
"IID": "IID_A",
"method": "doA"
},
"eff_B": {
"code": "b",
"name": "B",
"order": "1",
"IID": "IID_B",
"method": "doB"
}
};
Engine.ListDirectoryFiles = () => Object.keys(effects);
Engine.ReadJSONFile = (file) => effects[file];
const attackEffects = new AttackEffects();
TS_ASSERT_UNEVAL_EQUALS(attackEffects.Receivers(), [{
"type": "b",
"IID": "IID_B",
"method": "doB"
}, {
"type": "a",
"IID": "IID_A",
"method": "doA"
}]);