Skip to content

Commit 5599db5

Browse files
misc interop
1 parent 36759af commit 5599db5

3 files changed

Lines changed: 11 additions & 13 deletions

File tree

packages/cli/src/lib/walker-package-ranger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async function walkExportPatterns(dependency, condition, resolvedRoot) {
9292
// https://app.unpkg.com/three@0.180.0/files/package.json
9393
const needle = condition.endsWith("/*") ? `${condition}*` : condition;
9494
const matches = fs.promises.glob(needle.startsWith("/") ? needle.replace("/", "") : needle, {
95-
cwd: new URL(resolvedRoot),
95+
cwd: new URL(resolvedRoot).pathname,
9696
});
9797

9898
for await (const match of matches) {

packages/cli/test/cases/serve.default.error/serve.default.error.spec.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,10 @@ describe("Serve Greenwood With: ", function () {
3636

3737
describe("Running the serve command without running the build command first", function () {
3838
it("should throw an error that no build output was detected", async function () {
39-
try {
40-
await runner.setup(outputPath);
41-
await runner.runCommand(cliPath, "serve");
42-
} catch (err) {
43-
expect(err).to.contain(
44-
"Error: No build output detected. Make sure you have run greenwood build",
45-
);
46-
}
39+
await runner.setup(outputPath);
40+
await expect(runner.runCommand(cliPath, "serve")).to.be.rejectedWith(
41+
"No build output detected. Make sure you have run greenwood build",
42+
);
4743
});
4844
});
4945

packages/plugin-graphql/test/cases/query-graph/query-graph.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,16 @@ describe("Build Greenwood With: ", function () {
9797
expect(lists.length).to.be.equal(1);
9898
});
9999

100+
// we _technically_ can't assume the order of pages but we can at least make sure all the files are there
101+
// this could easily be solved by adding an `order` property to the page's frontmatter
102+
// https://github.com/ProjectEvergreen/greenwood/pull/1308#issuecomment-3368603613
100103
it("should have a expected navigation output in the <header> based on pages in the graph", function () {
101104
const listItems = dom.window.document.querySelectorAll("body ul li");
102105

103106
expect(listItems.length).to.be.equal(3);
104-
105-
expect(listItems[0].innerHTML).to.contain("First Post");
106-
expect(listItems[1].innerHTML).to.contain("Second Post");
107-
expect(listItems[2].innerHTML).to.contain("Home");
107+
listItems.forEach((item) => {
108+
expect(["First Post", "Second Post", "Home"].includes(item.innerHTML));
109+
});
108110
});
109111
});
110112
});

0 commit comments

Comments
 (0)