mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
feat: enhance JavaScript test snippet with class and module exports
This commit is contained in:
parent
2337b2bb3e
commit
27f0ca3b08
1 changed files with 28 additions and 2 deletions
|
@ -407,8 +407,34 @@ class TestRepoMapAllLanguages(unittest.TestCase):
|
|||
),
|
||||
"javascript": (
|
||||
"test.js",
|
||||
"var greet= 1;function greet(name) {\n console.log(`Hello, ${name}!`);\n}\n",
|
||||
"greet", # Key symbol to check
|
||||
"""// Class definition
|
||||
class Person {
|
||||
constructor(name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
sayHello() {
|
||||
return `Hello, ${this.name}!`;
|
||||
}
|
||||
}
|
||||
|
||||
// Function declaration
|
||||
function greet(person) {
|
||||
return person.sayHello();
|
||||
}
|
||||
|
||||
// Variables and constants
|
||||
const DEFAULT_NAME = 'World';
|
||||
let currentPerson = new Person(DEFAULT_NAME);
|
||||
|
||||
// Export for use in other modules
|
||||
module.exports = {
|
||||
Person,
|
||||
greet,
|
||||
DEFAULT_NAME
|
||||
};
|
||||
""",
|
||||
"Person", # Key symbol to check
|
||||
),
|
||||
"ocaml": (
|
||||
"test.ml",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue