mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05: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": (
|
"javascript": (
|
||||||
"test.js",
|
"test.js",
|
||||||
"var greet= 1;function greet(name) {\n console.log(`Hello, ${name}!`);\n}\n",
|
"""// Class definition
|
||||||
"greet", # Key symbol to check
|
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": (
|
"ocaml": (
|
||||||
"test.ml",
|
"test.ml",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue