2024-01-23 19:04:35 +08:00
|
|
|
import * as styles1 from "./style.less";
|
|
|
|
|
import * as styles2 from "./style.modules.less";
|
|
|
|
|
|
|
|
|
|
it("should prefer relative", () => {
|
|
|
|
|
expect(styles1).toEqual(nsObj({}));
|
|
|
|
|
expect(styles2).toEqual(nsObj({
|
2024-02-22 19:58:59 +08:00
|
|
|
"style-module": "-_style_modules_less-style-module",
|
2024-01-23 19:04:35 +08:00
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
const style = getComputedStyle(document.body);
|
|
|
|
|
|
|
|
|
|
expect(style.getPropertyValue("background")).toBe(" red");
|
|
|
|
|
expect(style.getPropertyValue("color")).toBe(" red");
|
|
|
|
|
});
|