Skip to content

Conversation

@nnance
Copy link
Contributor

@nnance nnance commented Jan 24, 2024

You can build and test the bindings by running the test script. The provider isn't integrated with the bindings yet but I wanted to get feedback on project and build setup.

assert.doesNotThrow(testBasic, "testBasic threw an expection");
assert.throws(testInvalidParams, "testInvalidParams didn't throw");

console.log("Tests passed- everything looks OK!"); No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using vitest for testing. Here is a small example from one of the other tests:

import assert from "node:assert";
import { test, describe } from "vitest";
import { fixJson } from "./fixJson.js";

test("should handle empty input", () => {
  assert.strictEqual(fixJson(""), "");
});

Ideally we'd use the same testing lib and patterns everywhere (if this is intended to be an automated test).

@@ -0,0 +1,19 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to put helper scripts into the bin subfolder, e.g. packages/@modelfusion-llamacpp-bindings/bin/update_submodules.sh would follow that convention here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants