Skip to content

Commit

Permalink
Update Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khadijahazward committed Apr 18, 2024
1 parent b2c6457 commit 096ae12
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,23 @@ public void setup() throws IOException {
}

@Test(description = "Test doc command on a ballerina project.")
public void testDocCommand() throws IOException {
public void testDocCommand() {
Path projectPath = this.testResources.resolve("doc_project");
System.setProperty("user.dir", projectPath.toString());
Path destinationPath = projectPath.resolve("target")
.resolve("apidocs").resolve("foo").resolve("winery").resolve("0.1.0");
DocCommand docCommand = new DocCommand(this.printStream, this.printStream, false);
docCommand.execute();

Assert.assertTrue(Files.exists(this.testResources.resolve("doc_project").resolve("target")
.resolve("apidocs").resolve("foo").resolve("winery").resolve("0.1.0").resolve("index.html")));
Assert.assertTrue(Files.exists(destinationPath.resolve("api-docs.js")));
Assert.assertTrue(Files.exists(destinationPath.resolve("api-docs.json")));

Files.delete(this.testResources.resolve("doc_project").resolve("target")
.resolve("apidocs").resolve("foo").resolve("winery").resolve("0.1.0").resolve("index.html"));
/* Verify if all the UI components are present. */
Assert.assertTrue(Files.exists(destinationPath.resolve("bundle.js")));
Assert.assertTrue(Files.exists(destinationPath.resolve("favicon.ico")));
Assert.assertTrue(Files.exists(destinationPath.resolve("globals.css")));
Assert.assertTrue(Files.exists(destinationPath.resolve("index.html")));
Assert.assertTrue(Files.exists(destinationPath.resolve("vercel.svg")));
}

@Test(description = "Test doc command on a ballerina project with custom target dir.")
Expand Down

0 comments on commit 096ae12

Please sign in to comment.