esrefactor
esrefactor copied to clipboard
Code does not pass all tests
The current version as it stands does not pass all tests:
Checking global_declaration.js ...
FAIL: Mismatched declaration
Expected: {"type":"Identifier","name":"answer","range":[4,10]}
Actual: {"type":"Identifier","name":"answer","range":[36,42]}
FAIL: Mismatched renaming
Expected: ["var $; // declaration:answer","","$ = 42; // cursor:answer reference:answer","","console.log('The answer is', $); // reference:answer",""]
Actual: ["var answer; // declaration:answer","","$ = 42; // cursor:answer reference:answer","","console.log('The answer is', $); // reference:answer",""]
FAIL: Mismatched renaming
Expected: ["var $$; // declaration:answer","","$$ = 42; // cursor:answer reference:answer","","console.log('The answer is', $$); // reference:answer",""]
Actual: ["var answer; // declaration:answer","","$$ = 42; // cursor:answer reference:answer","","console.log('The answer is', $$); // reference:answer",""]
FAIL: Mismatched renaming
Expected: ["var _; // declaration:answer","","_ = 42; // cursor:answer reference:answer","","console.log('The answer is', _); // reference:answer",""]
Actual: ["var answer; // declaration:answer","","_ = 42; // cursor:answer reference:answer","","console.log('The answer is', _); // reference:answer",""]
FAIL: Mismatched renaming
Expected: ["var $unique; // declaration:answer","","$unique = 42; // cursor:answer reference:answer","","console.log('The answer is', $unique); // reference:answer",""]
Actual: ["var answer; // declaration:answer","","$unique = 42; // cursor:answer reference:answer","","console.log('The answer is', $unique); // reference:answer",""]
FAIL: Mismatched renaming
Expected: ["var loooooong_name; // declaration:answer","","loooooong_name = 42; // cursor:answer reference:answer","","console.log('The answer is', loooooong_name); // reference:answer",""]
Actual: ["var answer; // declaration:answer","","loooooong_name = 42; // cursor:answer reference:answer","","console.log('The answer is', loooooong_name); // reference:answer",""]
Checking global_init.js ...
Checking global_leak.js ...
FAIL: Mismatched declaration
Expected: null
Actual: {"type":"Identifier","name":"answer","range":[0,6]}
I tried to dive in and understand the tests, but that seems to be a bit more effort. Some docs on it or the use of some standard (BDD) tool would be great.
looks like test for global_declaration.js
is failing because of same/alike issue as described in #7
This issue is already fixed in #9