Has anyone had any luck getting tests to run with HOOT?
After 3 days of attempts, with "help" from both ChatGPT and Claude, I have not been able to get a test to run. The test suite registers, and by including console logs I can see that the .js runs from start to finish, but nothing runs within the test itself.
In frustration, I deleted my tests entirely and tried the most basic test from the the Odoo 19 documentation ...
import { expect, test } from "@odoo/hoot";
test("My first test", () => {
expect(2 + 2).toBe(4);
});This returned a message that the tests must be included in a suite - which by my reading is at odds with the clear statement in the documentation that ...
In Odoo, all test files are run in an isolated environment and are wrapped within a global describe block (with the name of the suite being the path of the test file).
With that in mind you should not need to declare a suite in your test files ...
Nonetheless, I tried the next simple example from the documentation ...
import { describe, expect, test } from "@odoo/hoot";
describe("My first suite", () => {
test("My first test", () => {
expect(2 + 2).toBe(4);
});
});
Now I was back to where I started. The suite runs, but not the tests. So I added back in some logging ...
import { describe, expect, test } from "@odoo/hoot";
console.log("STARTING");
describe("My first suite", () => {
console.log("Inside suite");
test("My first test", () => {
console.log("Inside test");
expect(2 + 2).toBe(4);
});
console.log("After test");
});
console.log("After suite");
The console log shows:
STARTING
Inside suite
After test
After suite